This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import seaborn as sns | |
import numpy as np | |
import matplotlib.pyplot as plt | |
%matplotlib inline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data=pd.read_csv("telecom_users.csv") | |
data.drop("Unnamed: 0",inplace=True,axis=1) | |
data.head() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print("Values in each gender \n",data['gender'].value_counts()) | |
sns.countplot(data=data,x='gender') # Gender Count | |
sns.countplot(data=data,x='gender',hue='Churn') # Churn rate gender wise |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data['SeniorCitizen'].unique() # Checking unique values in this attribute | |
print("Senior Citizen \n",data['SeniorCitizen'].value_counts()) # Value counts | |
sns.countplot(data=data,x='SeniorCitizen') # Count Senior Citizen | |
sns.countplot(data=data,x='SeniorCitizen',hue='Churn') # Churn rate senior citizen wise |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Checking unique values | |
data['Partner'].unique() | |
# Value count visualization | |
print("Partner \n",data['Partner'].value_counts()) | |
sns.countplot(data=data,x='Partner') | |
# Partner Wise Churn Rate | |
sns.countplot(data=data,x='Partner',hue='Churn') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Unique Values | |
data['Dependents'].unique() | |
# Value Count | |
print("Dependents\n",data['Dependents'].value_counts()) | |
sns.countplot(data=data,x='Dependents') | |
# Dependent wise Churn rate | |
sns.countplot(data=data,x='Dependents',hue='Churn') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Number of unique values | |
data['tenure'].nunique() | |
# Distplot | |
sns.distplot(data['tenure']) | |
# Boxplot | |
sns.boxplot(y=data['tenure']) | |
# Churn Rate wise Distribution | |
sns.boxplot(data=data,y='tenure',x='Churn') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Unique Values | |
data['PhoneService'].unique() | |
# Value Counts | |
print("Phone Service",data['PhoneService'].value_counts()) | |
# Visualization | |
sns.countplot(data=data,x='PhoneService') | |
# Phone Service wise | |
sns.countplot(data=data,x='PhoneService',hue='Churn') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Unique Values | |
data['MultipleLines'].unique() | |
# Value Count and Visualization | |
print("Multiple Lines \n",data['MultipleLines'].value_counts()) | |
sns.countplot(data=data,x='MultipleLines') | |
# Multiple Lines Wise | |
sns.countplot(data=data,x='MultipleLines',hue="Churn") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Unique Values | |
data['InternetService'].unique() | |
# Value Count and visualization | |
print("Internet Service\n",data['InternetService'].value_counts()) | |
sns.countplot(data=data,x='InternetService') | |
# Internet Service Wise | |
sns.countplot(data=data,x='InternetService',hue='Churn') |
OlderNewer