In [1]:
import numpy as np
import pandas as pd
In [2]:
CS=pd.read_excel("F:/2019 GB Python/Descstats.xlsx") # For Windows users hash has to be like this
CS.head()
Out[2]:
Sample 1 Sample 2 Group
0 28.686942 0.627870 A
1 30.811276 50.558054 A
2 28.477675 54.593256 A
3 31.689752 19.613195 A
4 31.132768 48.658675 A
In [3]:
import seaborn as sns #importing libraries that are most useful
import matplotlib.pyplot as plt
sns.set(color_codes =True)
%matplotlib inline
In [4]:
sns.boxplot(CS['Sample 1'])
Out[4]:
<matplotlib.axes._subplots.AxesSubplot at 0x9058d10>
In [5]:
sns.boxplot(CS['Sample 1'], orient = "v")
Out[5]:
<matplotlib.axes._subplots.AxesSubplot at 0x4193470>
In [7]:
bplot=sns.boxplot(CS['Sample 1'], orient = "v")
In [8]:
plot_file_name = "Boxplot.jpg"
bplot.figure.savefig(plot_file_name, format = 'jpeg', dpi = 100)
In [9]:
bplot=sns.boxplot(CS['Sample 1'], orient = "v", width = 0.3)
In [11]:
b=CS[['Sample 1', 'Sample 2']]
In [12]:
sns.boxplot(x='variable', y = 'value', data = pd.melt(b), width=0.3)
Out[12]:
<matplotlib.axes._subplots.AxesSubplot at 0x125aff0>
In [13]:
sns.boxplot(x=CS['Group'], y=CS['Sample 1'])
Out[13]:
<matplotlib.axes._subplots.AxesSubplot at 0x4b6e290>
In [14]:
sns.boxplot(x=CS['Group'], y=CS['Sample 2'])
Out[14]:
<matplotlib.axes._subplots.AxesSubplot at 0x4babf10>
In [ ]: