## 1.数据分析

“`python ax = sns.countplot(y,label=”Count”) “`

## 2.数据可视化

“`python # Second ten features data = pd.concat([y,data_n_2.iloc[:,10:20]],axis=1) data = pd.melt(data,id_vars=”diagnosis”, var_name=”features”, value_name=’value’) plt.figure(figsize=(10,10)) sns.violinplot(x=”features”, y=”value”, hue=”diagnosis”, data=data,split=True, inner=”quart”) plt.xticks(rotation=90) “`

“`python plt.figure(figsize=(10,10)) sns.boxplot(x=”features”, y=”value”, hue=”diagnosis”, data=data) plt.xticks(rotation=90) “`

Swarm plot 也是一种非常实用的数据分析的图表，下面分三张swarm plot来展示我们所有的数据

“`python sns.set(style=”whitegrid”, palette=”muted”) data_dia = y data = x data_n_2 = (data – data.mean()) / (data.std()) # standardization data = pd.concat([y,data_n_2.iloc[:,0:10]],axis=1) data = pd.melt(data,id_vars=”diagnosis”, var_name=”features”, value_name=’value’) plt.figure(figsize=(10,10)) tic = time.time() sns.swarmplot(x=”features”, y=”value”, hue=”diagnosis”, data=data) plt.xticks(rotation=90) “`

“`python data = pd.concat([y,data_n_2.iloc[:,10:20]],axis=1) data = pd.melt(data,id_vars=”diagnosis”, var_name=”features”, value_name=’value’) plt.figure(figsize=(10,10)) sns.swarmplot(x=”features”, y=”value”, hue=”diagnosis”, data=data) plt.xticks(rotation=90) “` “`python data = pd.concat([y,data_n_2.iloc[:,20:31]],axis=1) data = pd.melt(data,id_vars=”diagnosis”, var_name=”features”, value_name=’value’) plt.figure(figsize=(10,10)) sns.swarmplot(x=”features”, y=”value”, hue=”diagnosis”, data=data) toc = time.time() plt.xticks(rotation=90) print(“swarm plot time: “, toc-tic ,” s”) “`

“`python #correlation map f,ax = plt.subplots(figsize=(18, 18)) sns.heatmap(x.corr(), annot=True, linewidths=.5, fmt= ‘.1f’,ax=ax) “`