Created
November 17, 2018 17:25
-
-
Save ajoydas/1be0020fc0597d343a841d325f9604a7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 numpy as np | |
df3 = pd.read_csv('datasets/CustomerChurn.csv') | |
df3 = df3.drop('customerID', axis=1) | |
df3 = df3.replace(r'^\s+$', np.nan, regex=True) | |
df3['TotalCharges'] = df3['TotalCharges'].astype(float) | |
df3 = df3.fillna(df3.mean()) | |
df3.isnull().values.any() | |
for key in df3.keys(): | |
# print(np.unique(df3[key])) | |
print(key+' '+str(len(np.unique(df3[key])))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment