Chitranshu commited on
Commit
6efa89d
1 Parent(s): 9097e3c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -69,8 +69,8 @@ idf = df.interactive()
69
  category_1 = project_data['Category'].value_counts().nlargest(10)
70
  brand_1 = project_data["Brand"].value_counts().nlargest(15).sort_values(ascending=False)
71
  # Define the hvplot charts
72
- category_chart = category_1.hvplot.bar(rot=90, title='Category Distribution', color=['#206b33'], width=800, height=400)
73
- brand_chart = brand_1.hvplot.bar(rot=90, title='Brand Count Distribution (Top 15)', color=['#206b33'], width=800, height=400)
74
  price_chart = df.hvplot.kde(y='Price', color='#006400', width=800, height=400)
75
  discounted_price_chart = df.hvplot.kde(y='DiscountedPrice', color='#006400', width=800, height=400)
76
  brand_price = dict(sorted(brand_price.items(), key=lambda item: item[1], reverse=True))
@@ -117,9 +117,9 @@ def update_chart(event):
117
  elif event.new == 'Top Price Categories':
118
  panel_layout[1:] = [category_price_chart]
119
  elif event.new == 'Category Distribution':
120
- panel_layout[1:] = [category_chart]
121
  elif event.new == 'Brand Count Distribution':
122
- panel_layout[1:] = [brand_chart]
123
  elif event.new == 'Price':
124
  panel_layout[1:] = [price_chart]
125
  elif event.new == 'DiscountedPrice':
@@ -160,3 +160,7 @@ template = pn.template.FastListTemplate(
160
  )
161
 
162
  template.servable()
 
 
 
 
 
69
  category_1 = project_data['Category'].value_counts().nlargest(10)
70
  brand_1 = project_data["Brand"].value_counts().nlargest(15).sort_values(ascending=False)
71
  # Define the hvplot charts
72
+ category_chart1 = category_1.hvplot.bar(rot=90, title='Category Distribution', color=['#206b33'], width=800, height=400)
73
+ brand_chart1 = brand_1.hvplot.bar(rot=90, title='Brand Count Distribution (Top 15)', color=['#206b33'], width=800, height=400)
74
  price_chart = df.hvplot.kde(y='Price', color='#006400', width=800, height=400)
75
  discounted_price_chart = df.hvplot.kde(y='DiscountedPrice', color='#006400', width=800, height=400)
76
  brand_price = dict(sorted(brand_price.items(), key=lambda item: item[1], reverse=True))
 
117
  elif event.new == 'Top Price Categories':
118
  panel_layout[1:] = [category_price_chart]
119
  elif event.new == 'Category Distribution':
120
+ panel_layout[1:] = [category_chart1]
121
  elif event.new == 'Brand Count Distribution':
122
+ panel_layout[1:] = [brand_chart1]
123
  elif event.new == 'Price':
124
  panel_layout[1:] = [price_chart]
125
  elif event.new == 'DiscountedPrice':
 
160
  )
161
 
162
  template.servable()
163
+
164
+
165
+
166
+