Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/vuegen/streamlit_reportview.py
Original file line number Diff line number Diff line change
Expand Up @@ -755,14 +755,14 @@ def _generate_dataframe_content(self, dataframe) -> List[str]:
r.DataFrameFormat.XLSX.value_with_dot,
]:
dataframe_content.append("selected_sheet = 0")
sheet_names = table_utils.get_sheet_names(dataframe.file_path)
sheet_names = table_utils.get_sheet_names(df_file_path.as_posix())
if len(sheet_names) > 1:
# If there are multiple sheets, ask the user to select one

dataframe_content.append(
textwrap.dedent(
f"""\
sheet_names = table_utils.get_sheet_names("{dataframe.file_path}")
sheet_names = table_utils.get_sheet_names("{df_file_path.as_posix()}")
selected_sheet = st.selectbox("Select a sheet to display", options=sheet_names)
"""
)
Expand All @@ -775,7 +775,7 @@ def _generate_dataframe_content(self, dataframe) -> List[str]:
r.DataFrameFormat.XLSX.value_with_dot,
]:
dataframe_content.append(
f"""df = pd.{read_function.__name__}('{dataframe.file_path}', sheet_name=selected_sheet)\n"""
f"""df = pd.{read_function.__name__}('{df_file_path.as_posix()}', sheet_name=selected_sheet)\n"""
)
else:
dataframe_content.append(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
df_index += 1
st.markdown('''<h4 style='text-align: center; color: #2b8cbe;'>Abundance Table Example Xls</h4>''', unsafe_allow_html=True)
selected_sheet = 0
sheet_names = table_utils.get_sheet_names("/home/runner/work/vuegen/vuegen/docs/example_data/Basic_example_vuegen_demo_notebook/2_Dataframes/1_All_formats/2_abundance_table_example_xls.xls")
sheet_names = table_utils.get_sheet_names("docs/example_data/Basic_example_vuegen_demo_notebook/2_Dataframes/1_All_formats/2_abundance_table_example_xls.xls")
selected_sheet = st.selectbox("Select a sheet to display", options=sheet_names)

df = pd.read_excel('/home/runner/work/vuegen/vuegen/docs/example_data/Basic_example_vuegen_demo_notebook/2_Dataframes/1_All_formats/2_abundance_table_example_xls.xls', sheet_name=selected_sheet)
df = pd.read_excel('docs/example_data/Basic_example_vuegen_demo_notebook/2_Dataframes/1_All_formats/2_abundance_table_example_xls.xls', sheet_name=selected_sheet)


# Displays a DataFrame using AgGrid with configurable options.
Expand Down Expand Up @@ -103,7 +103,7 @@
df_index += 1
st.markdown('''<h4 style='text-align: center; color: #2b8cbe;'>Example Xlsx</h4>''', unsafe_allow_html=True)
selected_sheet = 0
df = pd.read_excel('/home/runner/work/vuegen/vuegen/docs/example_data/Basic_example_vuegen_demo_notebook/2_Dataframes/1_All_formats/5_example_xlsx.xlsx', sheet_name=selected_sheet)
df = pd.read_excel('docs/example_data/Basic_example_vuegen_demo_notebook/2_Dataframes/1_All_formats/5_example_xlsx.xlsx', sheet_name=selected_sheet)


# Displays a DataFrame using AgGrid with configurable options.
Expand Down