Spaces:
Build error
Build error
James McCool
commited on
Commit
·
5a57605
1
Parent(s):
88e5eb6
Remove unnecessary data manipulation in game rotation timeline plot
Browse files
app.py
CHANGED
|
@@ -693,7 +693,6 @@ with tab5:
|
|
| 693 |
check_rotation = team_backlog.sort_values(by=['GAME_DATE', 'Finish'], ascending=[False, True])
|
| 694 |
check_rotation['Start'] = check_rotation['Start'].astype(float)
|
| 695 |
check_rotation['Finish'] = check_rotation['Finish'].astype(float)
|
| 696 |
-
check_rotation['Task'] = check_rotation['Task'] + ' ' + check_rotation['Start'].astype(str)
|
| 697 |
st.write(check_rotation)
|
| 698 |
game_rot_stats = check_rotation.reindex(game_rot_cols,axis="columns")
|
| 699 |
game_rot_stats = game_rot_stats.drop_duplicates(subset='backlog_lookup')
|
|
@@ -702,7 +701,6 @@ with tab5:
|
|
| 702 |
fig.update_yaxes(autorange="reversed")
|
| 703 |
|
| 704 |
fig.layout.xaxis.type = 'linear'
|
| 705 |
-
fig.data[0].x = check_rotation.Start.tolist()
|
| 706 |
# Create a color map for each unique player
|
| 707 |
player_colors = px.colors.qualitative.Plotly[:len(check_rotation['PLAYER_NAME'].unique())]
|
| 708 |
color_map = dict(zip(check_rotation['PLAYER_NAME'].unique(), player_colors))
|
|
@@ -732,15 +730,12 @@ with tab5:
|
|
| 732 |
stats_disp = st.container()
|
| 733 |
check_rotation = working_data[working_data['backlog_lookup'] == game_id_var]
|
| 734 |
check_rotation = check_rotation.sort_values(by='Start', ascending=True)
|
| 735 |
-
# check_rotation['Task'] = check_rotation['Task'] + ' ' + check_rotation['Start'].astype(str)
|
| 736 |
game_rot_stats = check_rotation.reindex(game_rot_cols,axis="columns")
|
| 737 |
game_rot_stats = game_rot_stats.drop_duplicates(subset='PLAYER_NAME')
|
| 738 |
|
| 739 |
fig = px.timeline(check_rotation, x_start="Start", x_end="Finish", y="Task", range_x=[0,check_rotation["Finish"].max()], text='minutes')
|
| 740 |
|
| 741 |
fig.layout.xaxis.type = 'linear'
|
| 742 |
-
fig.data[0].x = check_rotation.delta.tolist()
|
| 743 |
-
fig.data[0].y = check_rotation.Task.tolist()
|
| 744 |
fig.update_yaxes(autorange="reversed")
|
| 745 |
|
| 746 |
fig.add_vline(x=12, line_width=3, line_dash="dash", line_color="green")
|
|
|
|
| 693 |
check_rotation = team_backlog.sort_values(by=['GAME_DATE', 'Finish'], ascending=[False, True])
|
| 694 |
check_rotation['Start'] = check_rotation['Start'].astype(float)
|
| 695 |
check_rotation['Finish'] = check_rotation['Finish'].astype(float)
|
|
|
|
| 696 |
st.write(check_rotation)
|
| 697 |
game_rot_stats = check_rotation.reindex(game_rot_cols,axis="columns")
|
| 698 |
game_rot_stats = game_rot_stats.drop_duplicates(subset='backlog_lookup')
|
|
|
|
| 701 |
fig.update_yaxes(autorange="reversed")
|
| 702 |
|
| 703 |
fig.layout.xaxis.type = 'linear'
|
|
|
|
| 704 |
# Create a color map for each unique player
|
| 705 |
player_colors = px.colors.qualitative.Plotly[:len(check_rotation['PLAYER_NAME'].unique())]
|
| 706 |
color_map = dict(zip(check_rotation['PLAYER_NAME'].unique(), player_colors))
|
|
|
|
| 730 |
stats_disp = st.container()
|
| 731 |
check_rotation = working_data[working_data['backlog_lookup'] == game_id_var]
|
| 732 |
check_rotation = check_rotation.sort_values(by='Start', ascending=True)
|
|
|
|
| 733 |
game_rot_stats = check_rotation.reindex(game_rot_cols,axis="columns")
|
| 734 |
game_rot_stats = game_rot_stats.drop_duplicates(subset='PLAYER_NAME')
|
| 735 |
|
| 736 |
fig = px.timeline(check_rotation, x_start="Start", x_end="Finish", y="Task", range_x=[0,check_rotation["Finish"].max()], text='minutes')
|
| 737 |
|
| 738 |
fig.layout.xaxis.type = 'linear'
|
|
|
|
|
|
|
| 739 |
fig.update_yaxes(autorange="reversed")
|
| 740 |
|
| 741 |
fig.add_vline(x=12, line_width=3, line_dash="dash", line_color="green")
|