Spaces:
Sleeping
Sleeping
Update pages/3_EDA_and_Feature_Engineering.py
Browse files
pages/3_EDA_and_Feature_Engineering.py
CHANGED
|
@@ -621,7 +621,7 @@ Customers who exited (especially "Inactive - Exited") tend to have a lower age r
|
|
| 621 |
st.write("### Grouped Data by Geography and Exiting Category")
|
| 622 |
|
| 623 |
# Group the data by Geography and Exiting Category
|
| 624 |
-
grouped_data =
|
| 625 |
'creditscore': 'mean',
|
| 626 |
'balance': 'mean',
|
| 627 |
'estimatedsalary': 'mean',
|
|
@@ -660,7 +660,7 @@ Customers who exited (especially "Inactive - Exited") tend to have a lower age r
|
|
| 660 |
st.write("### Average Balance by Geography and Exiting Category")
|
| 661 |
|
| 662 |
# Create the pivot table
|
| 663 |
-
pivot_table =
|
| 664 |
index='geography', columns='exiting_category',
|
| 665 |
values='balance', aggfunc='mean'
|
| 666 |
)
|
|
|
|
| 621 |
st.write("### Grouped Data by Geography and Exiting Category")
|
| 622 |
|
| 623 |
# Group the data by Geography and Exiting Category
|
| 624 |
+
grouped_data = df.groupby(['geography', 'exiting_category']).agg({
|
| 625 |
'creditscore': 'mean',
|
| 626 |
'balance': 'mean',
|
| 627 |
'estimatedsalary': 'mean',
|
|
|
|
| 660 |
st.write("### Average Balance by Geography and Exiting Category")
|
| 661 |
|
| 662 |
# Create the pivot table
|
| 663 |
+
pivot_table = df.pivot_table(
|
| 664 |
index='geography', columns='exiting_category',
|
| 665 |
values='balance', aggfunc='mean'
|
| 666 |
)
|