Skip to content

Instantly share code, notes, and snippets.

View ParthNipunDave's full-sized avatar

Parth Nipun Dave ParthNipunDave

  • NA
  • Ahmedabad
View GitHub Profile
@ParthNipunDave
ParthNipunDave / Telecom Company.py
Last active April 11, 2021 19:01
Telecom import
import pandas as pd
import seaborn as sns
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
@ParthNipunDave
ParthNipunDave / telecom_reading.py
Created April 11, 2021 19:07
Reading telecom dataset
data=pd.read_csv("telecom_users.csv")
data.drop("Unnamed: 0",inplace=True,axis=1)
data.head()
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
@ParthNipunDave
ParthNipunDave / Telecom_Senior_Citizen_EDA.py
Created April 12, 2021 07:31
This attribute tells us whether or not customer is senior citizen. Let's see whether or not being senior citizen makes any significant difference in churn rate.
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
# 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')
#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')
# 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')
# 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')
# 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")
#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')