Professional Documents
Culture Documents
CardioGoodFitness - Descriptive Statistics (2) (1) - Jupyter Notebook
CardioGoodFitness - Descriptive Statistics (2) (1) - Jupyter Notebook
Statistics
The market research team at AdRight is assigned the task to identify the profile of the typical customer for each
treadmill product offered by CardioGood Fitness. The market research team decides to investigate whether
there are differences across the product lines with respect to customer characteristics. The team decides to
collect data on individuals who purchased a treadmill at a CardioGoodFitness retail store during the prior three
months. The data are stored in the CardioGoodFitness.csv file.
In [0]:
import numpy as np
import pandas as pd
In [0]:
mydata = pd.read_csv('CardioGoodFitness.csv')
In [0]:
mydata.head()
Out[5]:
mydata.describe(include="all")
Out[8]:
In [0]:
mydata.info()
<class 'pandas.core.frame.DataFrame'>
In [0]:
mydata.hist(figsize=(20,30))
Out[14]:
Out[20]:
<matplotlib.axes._subplots.AxesSubplot at 0x1a199ac5c0>
In [0]:
pd.crosstab(mydata['Product'],mydata['Gender'] )
Out[21]:
Product
TM195 40 40
TM498 29 31
TM798 7 33
In [0]:
pd.crosstab(mydata['Product'],mydata['MaritalStatus'] )
Out[22]:
Product
TM195 48 32
TM498 36 24
TM798 23 17
In [0]:
Out[24]:
<matplotlib.axes._subplots.AxesSubplot at 0x1a19c83390>
In [0]:
Out[41]:
Product Gender
Female 27 13 27 13 27 13 27
TM195
Male 21 19 21 19 21 19 21
Female 15 14 15 14 15 14 15
TM498
Male 21 10 21 10 21 10 21
Female 4 3 4 3 4 3 4
TM798
Male 19 14 19 14 19 14 19
In [0]:
Out[42]:
Product Gender
In [0]:
Out[43]:
Product Gender
sns.pairplot(mydata)
Out[44]:
<seaborn.axisgrid.PairGrid at 0x1a19ed4898>
In [0]:
mydata['Age'].std()
Out[45]:
6.9434981353997953
In [0]:
mydata['Age'].mean()
Out[46]:
28.788888888888888
In [0]:
sns.distplot(mydata['Age'])
Out[50]:
<matplotlib.axes._subplots.AxesSubplot at 0x1a1b1bffd0>
In [0]:
mydata.hist(by='Gender',column = 'Age')
Out[58]:
In [0]:
mydata.hist(by='Gender',column = 'Income')
Out[59]:
mydata.hist(by='Gender',column = 'Miles')
Out[60]:
Out[62]:
corr = mydata.corr()
corr
Out[67]:
sns.heatmap(corr, annot=True)
Out[66]:
<matplotlib.axes._subplots.AxesSubplot at 0x1a1cb58a20>