Spaces:
Sleeping
Sleeping
Victor Rivera commited on
Commit ·
2f037a4
1
Parent(s): ec25389
Cambios dataPath en HuggingFace
Browse filesFiles changed (2)
- app.py+7-7
- dataBaseSetup.py+9-9
95 unmodified lines969798991001011025 unmodified lines1081091101111121131144 unmodified lines1191201211221231241254 unmodified lines1301311321331341351364 unmodified lines1411421431441451461473 unmodified lines1511521531541551561573 unmodified lines16116216316416516616795 unmodified linesst.write(df)if not df.empty:fig, ax = plt.subplots()df.plot(kind='bar', x='category_name', y='total_stock', ax=ax)st.pyplot(fig)elif selected_query == "Query 2: Get Order Items":5 unmodified linesst.write(df)if not df.empty:fig, ax = plt.subplots()df.plot(kind='bar', x='category_name', y='total_items', ax=ax)st.pyplot(fig)elif selected_query == "Query 3: Total Sales in Santa Cruz Bikes":4 unmodified linesst.write(df)if not df.empty:fig, ax = plt.subplots()df.plot(kind='bar', x='year_month', y='total_sales', ax=ax)st.pyplot(fig)elif selected_query == "Query 4: Total Sales in Baldwin Bikes":4 unmodified linesst.write(df)if not df.empty:fig, ax = plt.subplots()df.plot(kind='bar', x='year_month', y='total_sales', ax=ax)st.pyplot(fig)elif selected_query == "Query 5: Total Sales in Rowlett Bikes":4 unmodified linesst.write(df)if not df.empty:fig, ax = plt.subplots()df.plot(kind='bar', x='year_month', y='total_sales', ax=ax)st.pyplot(fig)elif selected_query == "Query 6: Staff with the Highest Number of Orders":3 unmodified linesst.write(df)if not df.empty:fig, ax = plt.subplots()df.plot(kind='bar', x='staff_name', y='order_count', ax=ax)st.pyplot(fig)elif selected_query == "Query 7: Staff with the Lowest Number of Orders":3 unmodified linesst.write(df)if not df.empty:fig, ax = plt.subplots()df.plot(kind='bar', x='staff_name', y='order_count', ax=ax)st.pyplot(fig)if __name__ == "__main__":95 unmodified lines969798991001011025 unmodified lines1081091101111121131144 unmodified lines1191201211221231241254 unmodified lines1301311321331341351364 unmodified lines1411421431441451461473 unmodified lines1511521531541551561573 unmodified lines16116216316416516616795 unmodified linesst.write(df)if not df.empty:fig, ax = plt.subplots()df.plot(kind='barh', x='category_name', y='total_stock', ax=ax)st.pyplot(fig)elif selected_query == "Query 2: Get Order Items":5 unmodified linesst.write(df)if not df.empty:fig, ax = plt.subplots()df.plot(kind='bah', x='category_name', y='total_items', ax=ax)st.pyplot(fig)elif selected_query == "Query 3: Total Sales in Santa Cruz Bikes":4 unmodified linesst.write(df)if not df.empty:fig, ax = plt.subplots()df.plot(kind='barh', x='year_month', y='total_sales', ax=ax)st.pyplot(fig)elif selected_query == "Query 4: Total Sales in Baldwin Bikes":4 unmodified linesst.write(df)if not df.empty:fig, ax = plt.subplots()df.plot(kind='barh', x='year_month', y='total_sales', ax=ax)st.pyplot(fig)elif selected_query == "Query 5: Total Sales in Rowlett Bikes":4 unmodified linesst.write(df)if not df.empty:fig, ax = plt.subplots()df.plot(kind='barh', x='year_month', y='total_sales', ax=ax)st.pyplot(fig)elif selected_query == "Query 6: Staff with the Highest Number of Orders":3 unmodified linesst.write(df)if not df.empty:fig, ax = plt.subplots()df.plot(kind='barh', x='staff_name', y='order_count', ax=ax)st.pyplot(fig)elif selected_query == "Query 7: Staff with the Lowest Number of Orders":3 unmodified linesst.write(df)if not df.empty:fig, ax = plt.subplots()df.plot(kind='barh', x='staff_name', y='order_count', ax=ax)st.pyplot(fig)if __name__ == "__main__":
127 unmodified lines128129130131132133134135136137138139140141142127 unmodified lines# Data import pathsdata_paths = {"customers": "/Users/victorg/Documents/Streamlitapp/InteractiveDBApp/CSV/customers.csv","staffs": "/Users/victorg/Documents/Streamlitapp/InteractiveDBApp/CSV/staffs.csv","products": "/Users/victorg/Documents/Streamlitapp/InteractiveDBApp/CSV/products.csv","categories": "/Users/victorg/Documents/Streamlitapp/InteractiveDBApp/CSV/categories.csv","stores": "/Users/victorg/Documents/Streamlitapp/InteractiveDBApp/CSV/stores.csv","brands": "/Users/victorg/Documents/Streamlitapp/InteractiveDBApp/CSV/brands.csv","stocks": "/Users/victorg/Documents/Streamlitapp/InteractiveDBApp/CSV/stocks.csv","orders": "/Users/victorg/Documents/Streamlitapp/InteractiveDBApp/CSV/orders.csv","order_items": "/Users/victorg/Documents/Streamlitapp/InteractiveDBApp/CSV/order_items.csv",}# Import data to tables127 unmodified lines128129130131132133134135136137138139140141142127 unmodified lines# Data import pathsdata_paths = {"customers": "CSV/customers.csv","staffs": "CSV/staffs.csv","products": "CSV/products.csv","categories": "CSV/categories.csv","stores": "CSV/stores.csv","brands": "CSV/brands.csv","stocks": "CSV/stocks.csv","orders": "CSV/orders.csv","order_items": "CSV/order_items.csv",}# Import data to tables
app.py+7-7
dataBaseSetup.py+9-9