ans123 commited on
Commit
5a11f8e
·
verified ·
1 Parent(s): a5d9217

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -293,7 +293,8 @@ def generate_plots():
293
  # Plot 1: Decision Breakdown
294
  try:
295
  plt.figure(figsize=(8, 6))
296
- sns.countplot(data=global_df, x='Decision', palette='viridis', order=global_df['Decision'].value_counts().index)
 
297
  plt.title('Decision Breakdown for the Fleet')
298
  plt.xlabel('Decision')
299
  plt.ylabel('Number of Trucks')
@@ -312,7 +313,8 @@ def generate_plots():
312
  # Filter out NaN/None ownership types if any remain for plotting robustness
313
  plot_df = global_df[global_df['ownership_type'].notna() & (global_df['ownership_type'] != 'NAN')]
314
  if not plot_df.empty:
315
- sns.boxplot(data=plot_df, x='ownership_type', y='total_repairs', palette='coolwarm')
 
316
  plt.title('Total Repairs by Ownership Type')
317
  plt.xlabel('Ownership Type')
318
  plt.ylabel('Total Repairs ($)')
 
293
  # Plot 1: Decision Breakdown
294
  try:
295
  plt.figure(figsize=(8, 6))
296
+ # Add hue and set legend=False to resolve FutureWarning
297
+ sns.countplot(data=global_df, x='Decision', hue='Decision', palette='viridis', order=global_df['Decision'].value_counts().index, legend=False)
298
  plt.title('Decision Breakdown for the Fleet')
299
  plt.xlabel('Decision')
300
  plt.ylabel('Number of Trucks')
 
313
  # Filter out NaN/None ownership types if any remain for plotting robustness
314
  plot_df = global_df[global_df['ownership_type'].notna() & (global_df['ownership_type'] != 'NAN')]
315
  if not plot_df.empty:
316
+ # Add hue and set legend=False to resolve FutureWarning
317
+ sns.boxplot(data=plot_df, x='ownership_type', y='total_repairs', hue='ownership_type', palette='coolwarm', legend=False)
318
  plt.title('Total Repairs by Ownership Type')
319
  plt.xlabel('Ownership Type')
320
  plt.ylabel('Total Repairs ($)')