Open AnatoliiShara opened 5 years ago
import pandas as pd df=pd.read_csv (r'C:\med_data.csv') df.head () df.tail () df.info () med_data.groupby(func, axis=0).mean() med_data.groupby(['col1', 'col2'])['col3'].mean()
import pandas as pd import matplotlib.pyplot as plt import seaborn as sns
site_stats = {'Facebook':[100,150,210,270,350], 'Twitter': [200, 300, 400, 500,700], 'LinkedIn': [400, 500, 600, 800, 1000] } df=pd.DataFrame (site_stats) df.plot () sns.kdeplot (df) sns.lmplot('Facebook','LinkedIn', data=df, fit_reg=False) sns.kdeplot(df.Twitter) sns.kdeplot(df.Facebook) sns.kdeplot(df.LinkedIn) sns.kdeplot(df.Facebook, df.Twitter) sns.distplot(df.LinkedIn) plt.hist(df.Facebook, alpha=.3) sns.rugplot(df.Facebook) sns.boxplot([df.Facebook, df.LinkedIn]) sns.violinplot([df.Facebook, df.Twitter]) sns.heatmap([df.Facebook, df.Twitter], annot=True, fmt="d") sns.clustermap(df)
Pandas 1
import pandas as pd df=pd.read_csv (r'C:\med_data.csv') df.head () df.tail () df.info () med_data.groupby(func, axis=0).mean() med_data.groupby(['col1', 'col2'])['col3'].mean()
Pandas 2
import pandas as pd import matplotlib.pyplot as plt import seaborn as sns
site_stats = {'Facebook':[100,150,210,270,350], 'Twitter': [200, 300, 400, 500,700], 'LinkedIn': [400, 500, 600, 800, 1000] } df=pd.DataFrame (site_stats) df.plot () sns.kdeplot (df) sns.lmplot('Facebook','LinkedIn', data=df, fit_reg=False) sns.kdeplot(df.Twitter) sns.kdeplot(df.Facebook) sns.kdeplot(df.LinkedIn) sns.kdeplot(df.Facebook, df.Twitter) sns.distplot(df.LinkedIn) plt.hist(df.Facebook, alpha=.3) sns.rugplot(df.Facebook) sns.boxplot([df.Facebook, df.LinkedIn]) sns.violinplot([df.Facebook, df.Twitter]) sns.heatmap([df.Facebook, df.Twitter], annot=True, fmt="d") sns.clustermap(df)