├── README.md └── # Pre Data Analysis /README.md: -------------------------------------------------------------------------------- 1 | 📊 Customer Churn Analysis Using Python 2 | 3 | This project focuses on analyzing customer churn data from a bank using Python. It includes exploratory data analysis (EDA), visual insights, and statistical techniques to uncover patterns that lead to customer attrition. Key visualizations include churn rates by geography, age group, tenure, and financial metrics like credit score and estimated salary. The goal is to better understand why customers leave and how data-driven decisions can help reduce churn. The analysis is powered by libraries like Pandas, Matplotlib, Seaborn, and Scikit-learn. 4 | -------------------------------------------------------------------------------- /# Pre Data Analysis: -------------------------------------------------------------------------------- 1 | Pre Data Analysis 2 | print("Missing:\n", df.isnull().sum()) 3 | print("\nTypes:\n", df.dtypes) 4 | 5 | if 'Geography' in df.columns: 6 | print("\nGeography:", df['Geography'].unique()) 7 | else: 8 | print("\n'Geography' column not found.") 9 | 10 | if 'Gender' in df.columns: 11 | print("Gender:", df['Gender'].unique()) 12 | else: 13 | print("'Gender' column not found.") 14 | 15 | print("\nHead:\n", df.head()) 16 | 17 | # Correlation Heatmap 18 | plt.figure(figsize=(14, 10)) 19 | sns.heatmap(df.select_dtypes(include=np.number).corr(), annot=True, cmap='coolwarm', fmt=".2f") 20 | plt.title("Correlation Heatmap") 21 | plt.show() 22 | 23 | # Histograms 24 | df.select_dtypes(include=np.number).hist(bins=20, figsize=(16, 12), color='skyblue') 25 | plt.suptitle("Numerical Feature Distribution") 26 | plt.tight_layout(rect=[0, 0.03, 1, 0.97]) 27 | plt.show() 28 | --------------------------------------------------------------------------------