-
Notifications
You must be signed in to change notification settings - Fork 561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
App 3 : EDA basket ball #16
Comments
Hello. I don't know if you solved this already since this has been here for a long time. I was hesitant of writing it since no one had any more issues with it but here is a solution. You need to either delete that column or transform it into some sort of numeric form. st.write("# Heatmap")
### Heatmap
if st.button('Heatmap'):
df_selected_team.to_csv('output.csv', index=False)
df = pd.read_csv('output.csv')
df_sel = df.drop(columns=['Pos', 'Tm','Player'], axis=1)
corr = df_sel.corr()
fig, ax = plt.subplots(nrows=1, ncols=1, figsize=(8,8))
ax = sns.heatmap(corr, mask=None, vmax=1, square=True)
st.pyplot(fig) |
OK will try it out
…On Thu, Oct 12, 2023 at 6:23 AM Luismbpr ***@***.***> wrote:
Hello. I don't know if you solved this already since this has been here
for a long time. I was hesitant of writing it since no one had any more
issues with it but here is a solution.
You need to either delete that column or transform it into some sort of
numeric form.
I would use something like this:
st.write("# Heatmap")### Heatmapif st.button('Heatmap'):
df_selected_team.to_csv('output.csv', index=False)
df = pd.read_csv('output.csv')
df_sel = df.drop(columns=['Pos', 'Tm','Player'], axis=1)
corr = df_sel.corr()
fig, ax = plt.subplots(nrows=1, ncols=1, figsize=(8,8))
ax = sns.heatmap(corr, mask=None, vmax=1, square=True)
st.pyplot(fig)
—
Reply to this email directly, view it on GitHub
<#16 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZTALUK65NI4HWSDNU2MPMDX645RRANCNFSM6AAAAAAYKOFQLI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
issue in heatmap
players column has first value Quincy Acy and when i click on heatmap it shows me the error below
ValueError: could not convert string to float: 'Quincy Acy'
Traceback:
File "C:\Users\HP\PycharmProjects\streamlit_apps\venv\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 565, in _run_script
exec(code, module.dict)
File "C:\Users\HP\PycharmProjects\streamlit_apps\venv\basketball-stats-webapp.py", line 62, in
corr = df.corr()
File "C:\Users\HP\PycharmProjects\streamlit_apps\venv\lib\site-packages\pandas\core\frame.py", line 10059, in corr
mat = data.to_numpy(dtype=float, na_value=np.nan, copy=False)
File "C:\Users\HP\PycharmProjects\streamlit_apps\venv\lib\site-packages\pandas\core\frame.py", line 1838, in to_numpy
result = self._mgr.as_array(dtype=dtype, copy=copy, na_value=na_value)
File "C:\Users\HP\PycharmProjects\streamlit_apps\venv\lib\site-packages\pandas\core\internals\managers.py", line 1732, in as_array
arr = self._interleave(dtype=dtype, na_value=na_value)
File "C:\Users\HP\PycharmProjects\streamlit_apps\venv\lib\site-packages\pandas\core\internals\managers.py", line 1794, in _interleave
result[rl.indexer] = arr
The text was updated successfully, but these errors were encountered: