Professional Documents
Culture Documents
CardioGoodFitness - Jupyter Notebook
CardioGoodFitness - Jupyter Notebook
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
%matplotlib inline
import warnings
warnings.filterwarnings('ignore')
Out[15]: Product Age Gender Education MaritalStatus Usage Fitness Income Miles
Out[18]: (180, 9)
In [20]: data.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 180 entries, 0 to 179
Data columns (total 9 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 Product 180 non-null object
1 Age 180 non-null int64
2 Gender 180 non-null object
3 Education 180 non-null int64
4 MaritalStatus 180 non-null object
5 Usage 180 non-null int64
6 Fitness 180 non-null int64
7 Income 180 non-null int64
8 Miles 180 non-null int64
dtypes: int64(6), object(3)
memory usage: 12.8+ KB
Out[22]: null
Product 0.0
Age 0.0
Gender 0.0
Education 0.0
MaritalStatus 0.0
Usage 0.0
Fitness 0.0
Income 0.0
Miles 0.0
In [23]: #summary of distribution for relevant variables
data.hist(figsize=(20,30))
Out[23]: array([[<AxesSubplot:title={'center':'Age'}>,
<AxesSubplot:title={'center':'Education'}>],
[<AxesSubplot:title={'center':'Usage'}>,
<AxesSubplot:title={'center':'Fitness'}>],
[<AxesSubplot:title={'center':'Income'}>,
<AxesSubplot:title={'center':'Miles'}>]], dtype=object)
In [24]: # Relationship between categorical and continuous variable
# Age distribution of gym goers with respect to gender
sns.boxplot(x="Gender", y="Age", data = data)
Product
TM195 40 40
TM498 29 31
TM798 7 33
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 [30]: ## Checking the distribution of the gender ##
Gender = data['Gender'].value_counts()
Gender
In [34]: sns.pairplot(data)
In [36]: sns.distplot(data['Fitness'])
Out[37]: array([<AxesSubplot:title={'center':'Female'}>,
<AxesSubplot:title={'center':'Male'}>], dtype=object)
Out[38]: <AxesSubplot:>
In [43]: # Identify missing values of dataframe
data.isnull()
Out[43]: Product Age Gender Education MaritalStatus Usage Fitness Income Miles
... ... ... ... ... ... ... ... ... ...
175 False False False False False False False False False
176 False False False False False False False False False
177 False False False False False False False False False
178 False False False False False False False False False
179 False False False False False False False False False
In [45]: import os
print(os.environ['PATH'])
C:\Users\HP\anaconda3;C:\Users\HP\anaconda3\Library\mingw-w64\bin;C:\Users
\HP\anaconda3\Library\usr\bin;C:\Users\HP\anaconda3\Library\bin;C:\Users\HP
\anaconda3\Scripts;C:\Users\HP\anaconda3\bin;C:\Users\HP\anaconda3\condabi
n;C:\Users\HP\anaconda3;C:\Users\HP\anaconda3\Library\mingw-w64\bin;C:\User
s\HP\anaconda3\Library\usr\bin;C:\Users\HP\anaconda3\Library\bin;C:\Users\H
P\anaconda3\Scripts;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbe
m;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;
C:\Users\HP\AppData\Local\Microsoft\WindowsApps;.
In [4]: pip install nbconvert
Collecting pyppeteer
Downloading pyppeteer-1.0.2-py3-none-any.whl (83 kB)
Requirement already satisfied: certifi>=2021 in c:\users\hp\anaconda3\lib\s
ite-packages (from pyppeteer) (2022.12.7)
Requirement already satisfied: appdirs<2.0.0,>=1.4.3 in c:\users\hp\anacond
a3\lib\site-packages (from pyppeteer) (1.4.4)
Collecting websockets<11.0,>=10.0
Downloading websockets-10.4-cp39-cp39-win_amd64.whl (101 kB)
Requirement already satisfied: tqdm<5.0.0,>=4.42.1 in c:\users\hp\anaconda3
\lib\site-packages (from pyppeteer) (4.64.0)
Collecting pyee<9.0.0,>=8.1.0
Downloading pyee-8.2.2-py2.py3-none-any.whl (12 kB)
Requirement already satisfied: urllib3<2.0.0,>=1.25.8 in c:\users\hp\anacon
da3\lib\site-packages (from pyppeteer) (1.26.9)
Requirement already satisfied: importlib-metadata>=1.4 in c:\users\hp\anaco
nda3\lib\site-packages (from pyppeteer) (4.11.3)
Requirement already satisfied: zipp>=0.5 in c:\users\hp\anaconda3\lib\site-
packages (from importlib-metadata>=1.4->pyppeteer) (3.7.0)
Requirement already satisfied: colorama in c:\users\hp\anaconda3\lib\site-p
ackages (from tqdm<5.0.0,>=4.42.1->pyppeteer) (0.4.4)
Installing collected packages: websockets, pyee, pyppeteer
Successfully installed pyee-8.2.2 pyppeteer-1.0.2 websockets-10.4
Note: you may need to restart the kernel to use updated packages.