Mpavan45 commited on
Commit
7ea3461
·
verified ·
1 Parent(s): 616b66f

Update pages/2_Data Cleaning and Processing .py

Browse files
pages/2_Data Cleaning and Processing .py CHANGED
@@ -188,20 +188,20 @@ if df is not None:
188
  """)
189
 
190
  # Store the cleaned data in session state
191
- st.session_state.cleaned_data = df
192
  st.write("""
193
  ### 11. **Store Cleaned Data in Session State**
194
  The cleaned DataFrame is stored in Streamlit’s session state, allowing it to persist across pages or interactions.
195
  """)
196
  # Display cleaned data
197
  st.subheader("Cleaned Data Preview:")
198
- st.dataframe(df)
199
  st.write("""
200
  ### 12. **Dataset Information**
201
  Displays basic information about the DataFrame such as column data types, non-null counts, and memory usage.
202
  """)
203
  buffer = StringIO()
204
- df.info(buf=buffer)
205
 
206
  # Display the content in Streamlit as Markdown
207
  st.subheader("Info of the Dataset:")
@@ -215,7 +215,7 @@ if df is not None:
215
  st.subheader("Download the Cleaned Data")
216
  st.download_button(
217
  label="Download CSV",
218
- data=df.to_csv(index=False),
219
  file_name="Cleaned_Hotel_Data.csv",
220
  mime="text/csv"
221
  )
 
188
  """)
189
 
190
  # Store the cleaned data in session state
191
+ st.session_state.cleaned_data = data
192
  st.write("""
193
  ### 11. **Store Cleaned Data in Session State**
194
  The cleaned DataFrame is stored in Streamlit’s session state, allowing it to persist across pages or interactions.
195
  """)
196
  # Display cleaned data
197
  st.subheader("Cleaned Data Preview:")
198
+ st.dataframe(data)
199
  st.write("""
200
  ### 12. **Dataset Information**
201
  Displays basic information about the DataFrame such as column data types, non-null counts, and memory usage.
202
  """)
203
  buffer = StringIO()
204
+ data.info(buf=buffer)
205
 
206
  # Display the content in Streamlit as Markdown
207
  st.subheader("Info of the Dataset:")
 
215
  st.subheader("Download the Cleaned Data")
216
  st.download_button(
217
  label="Download CSV",
218
+ data=data.to_csv(index=False),
219
  file_name="Cleaned_Hotel_Data.csv",
220
  mime="text/csv"
221
  )