In [2]:
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
sns.set(color_codes =True)
%matplotlib inline
In [3]:
Sales = pd.read_excel("F:/2019 GB Python/Regression.xlsx")
In [4]:
Sales.head()
Out[4]:
Sales Enquires LaborDeployed AvgResponseTime NoofStockOuts
0 20.6 5193 48 96.325071 2
1 12.4 4995 37 193.276852 8
2 18.6 5229 48 162.271452 4
3 19.8 5222 47 132.756201 4
4 7.5 4614 21 153.479144 8
In [4]:
sns.distplot(Sales.Sales, kde=False)
C:\Users\Neil\Anaconda3\lib\site-packages\scipy\stats\stats.py:1713: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.
  return np.add.reduce(sorted[indexer] * weights, axis=axis) / sumval
Out[4]:
<matplotlib.axes._subplots.AxesSubplot at 0x9cd8ed0>
In [5]:
sns.scatterplot(y=Sales.Sales, x=Sales.Enquires)
Out[5]:
<matplotlib.axes._subplots.AxesSubplot at 0x15b3890>
In [6]:
sns.pairplot(Sales, vars = ['Sales', 'Enquires'])
Out[6]:
<seaborn.axisgrid.PairGrid at 0x15f1bd0>
In [7]:
sns.pairplot(Sales, vars = ['Sales', 'Enquires', 'LaborDeployed','AvgResponseTime', 'NoofStockOuts'])
Out[7]:
<seaborn.axisgrid.PairGrid at 0x174e710>
In [6]:
cor = Sales.corr(method='pearson')
cor
Out[6]:
Sales Enquires LaborDeployed AvgResponseTime NoofStockOuts
Sales 1.000000 0.693551 0.609308 -0.146156 -0.777959
Enquires 0.693551 1.000000 0.910704 -0.125756 -0.176915
LaborDeployed 0.609308 0.910704 1.000000 -0.077711 -0.110578
AvgResponseTime -0.146156 -0.125756 -0.077711 1.000000 0.115509
NoofStockOuts -0.777959 -0.176915 -0.110578 0.115509 1.000000
In [7]:
sns.heatmap(cor)
Out[7]:
<matplotlib.axes._subplots.AxesSubplot at 0x9842510>
In [ ]: