Victor Rivera commited on
Commit
2f037a4
1 Parent(s): ec25389

Cambios dataPath en HuggingFace

Browse files
Files changed (2) hide show
  1. app.py +7 -7
  2. dataBaseSetup.py +9 -9
app.py CHANGED
@@ -96,7 +96,7 @@ def app():
96
  st.write(df)
97
  if not df.empty:
98
  fig, ax = plt.subplots()
99
- df.plot(kind='bar', x='category_name', y='total_stock', ax=ax)
100
  st.pyplot(fig)
101
 
102
  elif selected_query == "Query 2: Get Order Items":
@@ -108,7 +108,7 @@ def app():
108
  st.write(df)
109
  if not df.empty:
110
  fig, ax = plt.subplots()
111
- df.plot(kind='bar', x='category_name', y='total_items', ax=ax)
112
  st.pyplot(fig)
113
 
114
  elif selected_query == "Query 3: Total Sales in Santa Cruz Bikes":
@@ -119,7 +119,7 @@ def app():
119
  st.write(df)
120
  if not df.empty:
121
  fig, ax = plt.subplots()
122
- df.plot(kind='bar', x='year_month', y='total_sales', ax=ax)
123
  st.pyplot(fig)
124
 
125
  elif selected_query == "Query 4: Total Sales in Baldwin Bikes":
@@ -130,7 +130,7 @@ def app():
130
  st.write(df)
131
  if not df.empty:
132
  fig, ax = plt.subplots()
133
- df.plot(kind='bar', x='year_month', y='total_sales', ax=ax)
134
  st.pyplot(fig)
135
 
136
  elif selected_query == "Query 5: Total Sales in Rowlett Bikes":
@@ -141,7 +141,7 @@ def app():
141
  st.write(df)
142
  if not df.empty:
143
  fig, ax = plt.subplots()
144
- df.plot(kind='bar', x='year_month', y='total_sales', ax=ax)
145
  st.pyplot(fig)
146
 
147
  elif selected_query == "Query 6: Staff with the Highest Number of Orders":
@@ -151,7 +151,7 @@ def app():
151
  st.write(df)
152
  if not df.empty:
153
  fig, ax = plt.subplots()
154
- df.plot(kind='bar', x='staff_name', y='order_count', ax=ax)
155
  st.pyplot(fig)
156
 
157
  elif selected_query == "Query 7: Staff with the Lowest Number of Orders":
@@ -161,7 +161,7 @@ def app():
161
  st.write(df)
162
  if not df.empty:
163
  fig, ax = plt.subplots()
164
- df.plot(kind='bar', x='staff_name', y='order_count', ax=ax)
165
  st.pyplot(fig)
166
 
167
  if __name__ == "__main__":
 
96
  st.write(df)
97
  if not df.empty:
98
  fig, ax = plt.subplots()
99
+ df.plot(kind='barh', x='category_name', y='total_stock', ax=ax)
100
  st.pyplot(fig)
101
 
102
  elif selected_query == "Query 2: Get Order Items":
 
108
  st.write(df)
109
  if not df.empty:
110
  fig, ax = plt.subplots()
111
+ df.plot(kind='bah', x='category_name', y='total_items', ax=ax)
112
  st.pyplot(fig)
113
 
114
  elif selected_query == "Query 3: Total Sales in Santa Cruz Bikes":
 
119
  st.write(df)
120
  if not df.empty:
121
  fig, ax = plt.subplots()
122
+ df.plot(kind='barh', x='year_month', y='total_sales', ax=ax)
123
  st.pyplot(fig)
124
 
125
  elif selected_query == "Query 4: Total Sales in Baldwin Bikes":
 
130
  st.write(df)
131
  if not df.empty:
132
  fig, ax = plt.subplots()
133
+ df.plot(kind='barh', x='year_month', y='total_sales', ax=ax)
134
  st.pyplot(fig)
135
 
136
  elif selected_query == "Query 5: Total Sales in Rowlett Bikes":
 
141
  st.write(df)
142
  if not df.empty:
143
  fig, ax = plt.subplots()
144
+ df.plot(kind='barh', x='year_month', y='total_sales', ax=ax)
145
  st.pyplot(fig)
146
 
147
  elif selected_query == "Query 6: Staff with the Highest Number of Orders":
 
151
  st.write(df)
152
  if not df.empty:
153
  fig, ax = plt.subplots()
154
+ df.plot(kind='barh', x='staff_name', y='order_count', ax=ax)
155
  st.pyplot(fig)
156
 
157
  elif selected_query == "Query 7: Staff with the Lowest Number of Orders":
 
161
  st.write(df)
162
  if not df.empty:
163
  fig, ax = plt.subplots()
164
+ df.plot(kind='barh', x='staff_name', y='order_count', ax=ax)
165
  st.pyplot(fig)
166
 
167
  if __name__ == "__main__":
dataBaseSetup.py CHANGED
@@ -128,15 +128,15 @@ def main():
128
 
129
  # Data import paths
130
  data_paths = {
131
- "customers": "/Users/victorg/Documents/Streamlitapp/InteractiveDBApp/CSV/customers.csv",
132
- "staffs": "/Users/victorg/Documents/Streamlitapp/InteractiveDBApp/CSV/staffs.csv",
133
- "products": "/Users/victorg/Documents/Streamlitapp/InteractiveDBApp/CSV/products.csv",
134
- "categories": "/Users/victorg/Documents/Streamlitapp/InteractiveDBApp/CSV/categories.csv",
135
- "stores": "/Users/victorg/Documents/Streamlitapp/InteractiveDBApp/CSV/stores.csv",
136
- "brands": "/Users/victorg/Documents/Streamlitapp/InteractiveDBApp/CSV/brands.csv",
137
- "stocks": "/Users/victorg/Documents/Streamlitapp/InteractiveDBApp/CSV/stocks.csv",
138
- "orders": "/Users/victorg/Documents/Streamlitapp/InteractiveDBApp/CSV/orders.csv",
139
- "order_items": "/Users/victorg/Documents/Streamlitapp/InteractiveDBApp/CSV/order_items.csv",
140
  }
141
 
142
  # Import data to tables
 
128
 
129
  # Data import paths
130
  data_paths = {
131
+ "customers": "CSV/customers.csv",
132
+ "staffs": "CSV/staffs.csv",
133
+ "products": "CSV/products.csv",
134
+ "categories": "CSV/categories.csv",
135
+ "stores": "CSV/stores.csv",
136
+ "brands": "CSV/brands.csv",
137
+ "stocks": "CSV/stocks.csv",
138
+ "orders": "CSV/orders.csv",
139
+ "order_items": "CSV/order_items.csv",
140
  }
141
 
142
  # Import data to tables