Open odagayev opened 2 years ago
Hello. I propose the following minor changes. This is to make sure there are no conflicts regarding strings on the correlation so the heat map is displayed.
The code would be:
# Heatmap
if st.button('Intercorrelation Heatmap'):
st.header('Intercorrelation Matrix Heatmap')
df_selected_team.to_csv('output.csv',index=False)
df = pd.read_csv('output.csv')
#Dropping Non-Numerical (string) Columns
df_selected_htmp = df.drop(columns=['Player', 'Pos', 'Tm'], axis=1)
# 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"):
f, ax = plt.subplots(figsize=(7, 5))
ax = sns.heatmap(corr, mask=mask, vmax=1, square=True)
st.pyplot(f)
Changing the data type to str in order to avoid the "("Expected bytes, got a 'int' object", 'Conversion failed for column FG% with type object')" error by the st.dataframe on line 45.
This is a new error introduced in streamlit v.85.