Mpavan45 commited on
Commit
757df75
·
verified ·
1 Parent(s): f8ea0d3

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 = 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,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=data.to_csv(index=False),
219
  file_name="Cleaned_Hotel_Data.csv",
220
  mime="text/csv"
221
  )
@@ -226,7 +226,7 @@ else:
226
 
227
  # Define the URL of the background image (use your own image URL)
228
  # Apply custom CSS for the background image and overlay
229
- background_image_url = "https://cdn-uploads.huggingface.co/production/uploads/675fab3a2d0851e23d23cad3/MI0hTKaf1a2EmxUfA6TsV.png"
230
  st.markdown(
231
  f"""
232
  <style>
@@ -258,7 +258,7 @@ st.markdown(
258
  }}
259
  /* Styling the markdown content */
260
  .stMarkdown {{
261
- color: white; /* White text to ensure visibility */
262
  font-size: 100px; /* Adjust font size for readability */
263
  }}
264
  </style>
 
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(cleaned_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
+ cleaned_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=cleaned_data.to_csv(index=False),
219
  file_name="Cleaned_Hotel_Data.csv",
220
  mime="text/csv"
221
  )
 
226
 
227
  # Define the URL of the background image (use your own image URL)
228
  # Apply custom CSS for the background image and overlay
229
+ background_image_url = "https://cdn-uploads.huggingface.co/production/uploads/675fab3a2d0851e23d23cad3/uuRffDOdqb_CQPlKm3_J5.jpeg"
230
  st.markdown(
231
  f"""
232
  <style>
 
258
  }}
259
  /* Styling the markdown content */
260
  .stMarkdown {{
261
+ color: black; /* White text to ensure visibility */
262
  font-size: 100px; /* Adjust font size for readability */
263
  }}
264
  </style>