nesticot commited on
Commit
409155f
·
verified ·
1 Parent(s): b6eaec2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -752,7 +752,11 @@ def server(input, output, session):
752
  df = df.with_columns([pl.col(col).cast(pl.Int32) for col in columns_to_cast])
753
  df_2 = df_2.with_columns([pl.col(col).cast(pl.Int32) for col in columns_to_cast])
754
 
755
- df_legend = pl.concat([df, df_2], rechunk=True)
 
 
 
 
756
  # # Create legend for pitch types
757
  items_in_order = (df_legend.sort("pitch_count", descending=True)['pitch_type'].unique(maintain_order=True).to_numpy())
758
  colour_pitches = [dict_colour[x] for x in items_in_order]
 
752
  df = df.with_columns([pl.col(col).cast(pl.Int32) for col in columns_to_cast])
753
  df_2 = df_2.with_columns([pl.col(col).cast(pl.Int32) for col in columns_to_cast])
754
 
755
+ common_cols = list(set(df.columns) & set(df_2.columns))
756
+
757
+
758
+
759
+ df_legend = pl.concat([df.select(common_cols), df_2.select(common_cols)], rechunk=True)
760
  # # Create legend for pitch types
761
  items_in_order = (df_legend.sort("pitch_count", descending=True)['pitch_type'].unique(maintain_order=True).to_numpy())
762
  colour_pitches = [dict_colour[x] for x in items_in_order]