-
Notifications
You must be signed in to change notification settings - Fork 4k
Closed
Labels
area:arrowRelated to Arrow data serializationRelated to Arrow data serializationfeature:st.dataframeRelated to the `st.dataframe` elementRelated to the `st.dataframe` elementtype:enhancementRequests for feature enhancements or new featuresRequests for feature enhancements or new features
Description
Summary
Pandas supports a Categorical Index datatype. When using st.write(dataframe), if the dataframe contains some categorical data an error is generated.
Steps to reproduce
Create a dataframe with a Categorical Index. For example: uses pd.cut to segment existing numerical data (https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.cut.html)
This is a snippet that takes a median_income column and segments it (from https://github.com/ageron/handson-ml/blob/master/02_end_to_end_machine_learning_project.ipynb row 22)
Expected behavior:
No error. The dataframe is shown in the UI.
Actual behavior:
st.write(df['income_cat'])
NotImplementedError: Can't handle <class 'pandas.core.indexes.category.CategoricalIndex'> yet.
st.write(df['income_cat'].value_counts())```
## Is this a regression?
Not that I know
# Debug info
- Streamlit version: Streamlit v0.45.0
- Python version: 3.7.4
- Using Conda? PipEnv? PyEnv? Pex?
- OS version: MacOs 10.14.6
- Browser version: Chrome 76.0.3809.100
# Additional information
If needed, add any other context about the problem here.
thingumajig, pietz, bgelineau, GUZHIXIANG, crypdick and 2 morecompartia
Metadata
Metadata
Assignees
Labels
area:arrowRelated to Arrow data serializationRelated to Arrow data serializationfeature:st.dataframeRelated to the `st.dataframe` elementRelated to the `st.dataframe` elementtype:enhancementRequests for feature enhancements or new featuresRequests for feature enhancements or new features