Spaces:
Sleeping
Sleeping
Update pages/2_Data Cleaning and Processing .py
Browse files
pages/2_Data Cleaning and Processing .py
CHANGED
|
@@ -711,15 +711,15 @@ if df is not None:
|
|
| 711 |
# Drop rows where price is greater than 40000
|
| 712 |
# Check if the 'price' column exists
|
| 713 |
if 'price' in df.columns:
|
| 714 |
-
|
| 715 |
-
|
| 716 |
-
|
| 717 |
-
|
| 718 |
-
|
| 719 |
-
|
| 720 |
-
|
| 721 |
-
|
| 722 |
-
|
| 723 |
# Redirect the output of df.info() to a string buffer
|
| 724 |
buffer = StringIO()
|
| 725 |
df.info(buf=buffer)
|
|
|
|
| 711 |
# Drop rows where price is greater than 40000
|
| 712 |
# Check if the 'price' column exists
|
| 713 |
if 'price' in df.columns:
|
| 714 |
+
st.write("### Original Dataset")
|
| 715 |
+
st.write(df['price'].describe()) # Use describe() for a summary of the 'price' column
|
| 716 |
+
|
| 717 |
+
# Filter rows where price is less than 600 or greater than 40,000
|
| 718 |
+
df_filtered = df[(df['price'] < 600) | (df['price'] > 40000)]
|
| 719 |
+
df.drop(df_filtered.index, inplace=True) # Drop rows based on the filtered indices
|
| 720 |
+
|
| 721 |
+
st.write("### Updated Dataset with Filtered Rows")
|
| 722 |
+
st.write(df['price'].describe()) # Display summary of the updated 'price' column
|
| 723 |
# Redirect the output of df.info() to a string buffer
|
| 724 |
buffer = StringIO()
|
| 725 |
df.info(buf=buffer)
|