From 10fecc38023999e5fd1d2841420e6b28d976406d Mon Sep 17 00:00:00 2001 From: Luismbpr <97373331+Luismbpr@users.noreply.github.com> Date: Wed, 11 Oct 2023 19:18:14 -0700 Subject: [PATCH 1/2] Update basketball_app.py Slight modification on heatmap to 1. Drop non-numerical columns (string columns Player, Pos, Tm) 2. Using st.pyplot(f) to show heatmap without any warnings. --- app_3_eda_basketball/basketball_app.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app_3_eda_basketball/basketball_app.py b/app_3_eda_basketball/basketball_app.py index 9dc72831..e9fc2cd1 100644 --- a/app_3_eda_basketball/basketball_app.py +++ b/app_3_eda_basketball/basketball_app.py @@ -59,10 +59,12 @@ def filedownload(df): df_selected_team.to_csv('output.csv',index=False) df = pd.read_csv('output.csv') - corr = df.corr() + df_selected_htmp = df.drop(columns=['Player', 'Pos', 'Tm'], axis=1)#Dropping Non-Numerical (string) Columns + #corr = df.corr() mask = np.zeros_like(corr) mask[np.triu_indices_from(mask)] = True with sns.axes_style("white"): f, ax = plt.subplots(figsize=(7, 5)) ax = sns.heatmap(corr, mask=mask, vmax=1, square=True) - st.pyplot() + #st.pyplot() + st.pyplot(f) From 48aec3809c09771afacea50b0bf48b898f9cf7f9 Mon Sep 17 00:00:00 2001 From: Luismbpr <97373331+Luismbpr@users.noreply.github.com> Date: Wed, 11 Oct 2023 21:41:44 -0700 Subject: [PATCH 2/2] Update basketball_app.py --- app_3_eda_basketball/basketball_app.py | 1 + 1 file changed, 1 insertion(+) diff --git a/app_3_eda_basketball/basketball_app.py b/app_3_eda_basketball/basketball_app.py index e9fc2cd1..6483b284 100644 --- a/app_3_eda_basketball/basketball_app.py +++ b/app_3_eda_basketball/basketball_app.py @@ -61,6 +61,7 @@ def filedownload(df): df_selected_htmp = df.drop(columns=['Player', 'Pos', 'Tm'], axis=1)#Dropping Non-Numerical (string) Columns #corr = df.corr() + corr = df_selected_htmp.corr() mask = np.zeros_like(corr) mask[np.triu_indices_from(mask)] = True with sns.axes_style("white"):