04pallav
9/11/2017 - 10:30 PM

Seaborn

Seaborn

import seaborn as sns
a=DataFrame(np.random.randn(25).reshape((5,5)),columns=list('abcde'))

sns.heatmap(a.corr()) #plotting heatmaps for the correlation matrix

data1 = randn(1000)
data2 = randn(1000)
sns.jointplot(data1,data2)

#jointplot needs two series x and y
#plots scatter plots along with individual distributions

sns.jointplot(data1,data2,kind='hex')
sns.jointplot(data1,data2,kind='kde')
#different kind of scatter plot

sns.rugplot(data1,color='black')
# can see how values are distributed using this
#just puts a tick where a value occurs #only uses an x

sns.distplot(data1) #(histograms+kde) are called distplots in seaborn
sns.distplot(data1,rug=True,hist=False)

sns.kdeplot(data1,kernel="gau") #plots probabilty distribution curve
#needs only x
kern= ["biw", "cos", "epa", "gau", "tri", "triw"] #by default gaussian

sns.lmplot("x","y",data1) #y and x are column names of dataframe data1

sns.heatmap(a) #shows dframe as a heatmap