Spaces:
Runtime error
Runtime error
Update pages/2_Data_CLeaning_and_Preprocessing.py
Browse files
pages/2_Data_CLeaning_and_Preprocessing.py
CHANGED
|
@@ -107,7 +107,14 @@ if uploaded_file is not None:
|
|
| 107 |
st.pyplot(fig)
|
| 108 |
else:
|
| 109 |
st.warning("'Category' column not found for plotting.")
|
|
|
|
| 110 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
# Data Cleaning Section
|
| 112 |
st.write("### Cleaned Dataset")
|
| 113 |
cleaned_data = data.drop_duplicates()
|
|
|
|
| 107 |
st.pyplot(fig)
|
| 108 |
else:
|
| 109 |
st.warning("'Category' column not found for plotting.")
|
| 110 |
+
# binning of age column
|
| 111 |
|
| 112 |
+
bins = [0, 18, 35, 50, 65, 100]
|
| 113 |
+
labels = ['Child', 'Young Adult', 'Adult', 'Middle Aged', 'Senior']
|
| 114 |
+
|
| 115 |
+
df['age_bins'] = pd.cut(df['CustomerAge'], bins=bins, labels=labels, right = False)
|
| 116 |
+
|
| 117 |
+
# df.head()
|
| 118 |
# Data Cleaning Section
|
| 119 |
st.write("### Cleaned Dataset")
|
| 120 |
cleaned_data = data.drop_duplicates()
|