<jupyter_start><jupyter_text>EDA<jupyter_code>df.describe(include=[np.number])
sns.countplot(y="Education",order=df["Education"].value_counts().index,data=df).set_title("Education Level of Customers")<jupyter_output><empty_output><jupyter_text>Info about attrition<jupyter_code>sns.set(rc={'figure.figsize':(5,5)}) #increase the size of the graph
attrited_rows = df.loc[df['Attrition_Flag'] == "Attrited Customer"]
sns.countplot(y='Gender', data=attrited_rows, palette='tab10').set_title('Attrition based on gender')<jupyter_output><empty_output><jupyter_text>Female customers, attrite more than males, however the difference is not that big.<jupyter_code>sns.set(rc={'figure.figsize':(10,8)}) #increase the size of the graph
for cardType in df["Card Type"].unique():
    print((len(attrited_rows[attrited_rows["Card Type"]==cardType])*100)/len(attrited_rows[attrited_rows["Card Type"]==cardType]))

catp = sns.catplot(data=attrited_rows, kind='count', 
                   x='Attrition_Flag', hue='Card Type',hue_order=df["Card Type"].value_counts().index).set(yscale="log")
# df2 = df[df["Card Type"]=="Platinum"]
# print((len(df2[df2["Attrition_Flag"]=="Attrited Customer"])*100)/len(df2))
# df2 = df[df["Card Type"]=="Blue"]
# print((len(df2[df2["Attrition_Flag"]=="Attrited Customer"])*100)/len(df2))
# df2 = df[df["Card Type"]=="Gold"]
# print((len(df2[df2["Attrition_Flag"]=="Attrited Customer"])*100)/len(df2))
# df2 = df[df["Card Type"]=="Silver"]
# print((len(df2[df2["Attrition_Flag"]=="Attrited Customer"])*100)/len(df2))<jupyter_output>27.272727272727273
15.671415580478932
16.049382716049383
16.11253196930946
{'fraction_non_alphanumeric': 0.19543773119605426, 'fraction_numerical': 0.06473489519112208, 'mean_word_length': 10.040816326530612, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '257776', 'license': 'MIT', 'n_tokens_mistral': 673, 'n_tokens_neox': 616, 'n_words': 79, 'path': 'analysis/Murad/.ipynb_checkpoints/EDA-checkpoint.ipynb', 'repo_name': 'data301-2020-winter2/course-project-group_1024', 'size': '1622'}