Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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]
|