GMARTINEZMILLA commited on
Commit
f329bd3
·
1 Parent(s): 8541c9c

feat: generated files

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -134,6 +134,9 @@ elif page == "Customer Analysis":
134
  # Combine top manufacturers from both lists and get up to 20 unique manufacturers
135
  combined_top = pd.concat([top_units, top_sales]).index.unique()[:20]
136
 
 
 
 
137
  # Create a DataFrame with combined data for these top manufacturers
138
  combined_data = pd.DataFrame({
139
  'units': all_manufacturers.loc[combined_top, all_manufacturers.columns[0]],
 
134
  # Combine top manufacturers from both lists and get up to 20 unique manufacturers
135
  combined_top = pd.concat([top_units, top_sales]).index.unique()[:20]
136
 
137
+ # Filter out manufacturers that are not present in both datasets
138
+ combined_top = [m for m in combined_top if m in all_manufacturers.index and m in sales_data_filtered.index]
139
+
140
  # Create a DataFrame with combined data for these top manufacturers
141
  combined_data = pd.DataFrame({
142
  'units': all_manufacturers.loc[combined_top, all_manufacturers.columns[0]],