-
Notifications
You must be signed in to change notification settings - Fork 4k
Closed
Labels
feature:st.data_editorRelated to the `st.data_editor` widgetRelated to the `st.data_editor` widgetfeature:st.dataframeRelated to the `st.dataframe` elementRelated to the `st.dataframe` elementpriority:P3Medium priorityMedium prioritystatus:confirmedBug has been confirmed by the Streamlit teamBug has been confirmed by the Streamlit teamtype:bugSomething isn't working as expectedSomething isn't working as expected
Description
Checklist
- I have searched the existing issues for similar issues.
- I added a very descriptive title to this issue.
- I have provided sufficient information below to help reproduce this issue.
Summary
When an empty string is provided for the 2nd column level, the first level is also empty. It does work correctly when the 1st level is the empty one.
Reproducible Code Example
import numpy as np
import pandas as pd
import streamlit as st
def main():
arrays = [
["bar", "bar", "baz", "baz", "foo", "foo", "qux"],
["one", "two", "one", "two", "one", "two", ""],
]
tuples = list(zip(*arrays))
index = pd.MultiIndex.from_tuples(tuples, names=["first", "second"])
df = pd.DataFrame(np.random.randn(3, 7), index=["A", "B", "C"], columns=index)
st.dataframe(df)
if __name__ == '__main__':
import streamlit.web.bootstrap
if '__streamlitmagic__' not in locals():
st.web.bootstrap.run(__file__, False, [], {})
main()Steps To Reproduce
Run the example code.
Expected Behavior
Current Behavior
Is this a regression?
- Yes, this used to work in a previous version.
Debug info
- Streamlit version: 1.39
- Python version: 3.12
- Operating System: Win10
- Browser: Edge
Additional Information
As a workaround, using " " instead of an empty string for the 2nd level makes the first level be shown.
github-actions, benasse, Dev-iL and lukasmasuch
Metadata
Metadata
Assignees
Labels
feature:st.data_editorRelated to the `st.data_editor` widgetRelated to the `st.data_editor` widgetfeature:st.dataframeRelated to the `st.dataframe` elementRelated to the `st.dataframe` elementpriority:P3Medium priorityMedium prioritystatus:confirmedBug has been confirmed by the Streamlit teamBug has been confirmed by the Streamlit teamtype:bugSomething isn't working as expectedSomething isn't working as expected

