Skip to content
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

Error for Boston House Regression - Data format #1

Open
paluigi opened this issue Jan 31, 2021 · 2 comments
Open

Error for Boston House Regression - Data format #1

paluigi opened this issue Jan 31, 2021 · 2 comments

Comments

@paluigi
Copy link

paluigi commented Jan 31, 2021

Hello, while launching the boston house regression app (app 9) I get this error:

KeyError: <class 'numpy.float64'>
Traceback:
File "/home/xxx/anaconda3/envs/stl/lib/python3.8/site-packages/streamlit/script_runner.py", line 332, in _run_script
exec(code, module.dict)
File "/home/xxx/github/streamlit_freecodecamp/app_9_regression_boston_housing/boston-house-ml-app.py", line 54, in
df = user_input_features()
File "/home/xxx/github/streamlit_freecodecamp/app_9_regression_boston_housing/boston-house-ml-app.py", line 25, in user_input_features
CRIM = st.sidebar.slider('CRIM', X.CRIM.min(), X.CRIM.max(), X.CRIM.mean())
File "/home/xxx/anaconda3/envs/stl/lib/python3.8/site-packages/streamlit/elements/slider.py", line 159, in slider
data_type = SUPPORTED_TYPES[type(value[0])]

It seems there something odd between the format in which data in the sidebar are saved and the way the program expects them?
Any help is appreciated!
Thanks

@Jannik098
Copy link

Hey there, I'm not an expert myself but the problem is that streamlit complains about the min() and max() returning int64 instead of int. I found it here: streamlit/streamlit#1065 (comment)

If you adjust all the sliders like this, it works for me:
CRIM = st.sidebar.slider('CRIM', float(X.CRIM.min()), float(X.CRIM.max()), float(X.CRIM.mean()))

@amulya25p
Copy link

Hey there, I'm not an expert myself but the problem is that streamlit complains about the min() and max() returning int64 instead of int. I found it here: streamlit/streamlit#1065 (comment)

If you adjust all the sliders like this, it works for me: CRIM = st.sidebar.slider('CRIM', float(X.CRIM.min()), float(X.CRIM.max()), float(X.CRIM.mean()))

this worked for me! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants