Update pages/3_EDA_and_Feature_Engineering.py
Browse files
pages/3_EDA_and_Feature_Engineering.py
CHANGED
|
@@ -31,8 +31,8 @@ st.markdown(
|
|
| 31 |
position: absolute;
|
| 32 |
top: 0;
|
| 33 |
left: 0;
|
| 34 |
-
width:
|
| 35 |
-
height:
|
| 36 |
background: rgba(0, 0, 0, 0.4); /* Adjust transparency here (0.4 for 40% transparency) */
|
| 37 |
z-index: -1;
|
| 38 |
}}
|
|
@@ -66,6 +66,15 @@ if df is not None:
|
|
| 66 |
|
| 67 |
df = df.rename(columns={'ProductCategory': 'Category', 'ProductBrand': 'Brand', 'ProductPrice': 'Price'})
|
| 68 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
# Shape of Dataset
|
| 70 |
st.write(f"The dataset has {df.shape[0]} rows and {df.shape[1]} columns.")
|
| 71 |
|
|
|
|
| 31 |
position: absolute;
|
| 32 |
top: 0;
|
| 33 |
left: 0;
|
| 34 |
+
width: 70%;
|
| 35 |
+
height: 70%;
|
| 36 |
background: rgba(0, 0, 0, 0.4); /* Adjust transparency here (0.4 for 40% transparency) */
|
| 37 |
z-index: -1;
|
| 38 |
}}
|
|
|
|
| 66 |
|
| 67 |
df = df.rename(columns={'ProductCategory': 'Category', 'ProductBrand': 'Brand', 'ProductPrice': 'Price'})
|
| 68 |
|
| 69 |
+
# binning of age column
|
| 70 |
+
|
| 71 |
+
bins = [0, 18, 35, 50, 65, 100]
|
| 72 |
+
labels = ['Child', 'Young Adult', 'Adult', 'Middle Aged', 'Senior']
|
| 73 |
+
|
| 74 |
+
df['age_bins'] = pd.cut(df['CustomerAge'], bins=bins, labels=labels, right = False)
|
| 75 |
+
|
| 76 |
+
# df.head()
|
| 77 |
+
|
| 78 |
# Shape of Dataset
|
| 79 |
st.write(f"The dataset has {df.shape[0]} rows and {df.shape[1]} columns.")
|
| 80 |
|