0% found this document useful (0 votes)
10 views3 pages

lab task 8 .ipynb - Colab

Uploaded by

hbashir659
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views3 pages

lab task 8 .ipynb - Colab

Uploaded by

hbashir659
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

import pandas as pd

Df=pd.read_csv('/content/gym_members_exercise_tracking.csv')

Df

Weight Height Session_Duration Water_I


Age Gender Max_BPM Avg_BPM Resting_BPM Calories_Burned Workout_Type Fat_Percentage
(kg) (m) (hours) (li

0 56 Male 88.3 1.71 180 157 60 1.69 1313.0 Yoga 12.6

1 46 Female 74.9 1.53 179 151 66 1.30 883.0 HIIT 33.9

2 32 Female 68.1 1.66 167 122 54 1.11 677.0 Cardio 33.4

3 25 Male 53.2 1.70 190 164 56 0.59 532.0 Strength 28.8

4 38 Male 46.1 1.79 188 158 68 0.64 556.0 Strength 29.2

... ... ... ... ... ... ... ... ... ... ... ...

968 24 Male 87.1 1.74 187 158 67 1.57 1364.0 Strength 10.0

969 25 Male 66.6 1.61 184 166 56 1.38 1260.0 Strength 25.0

970 59 Female 60.4 1.76 194 120 53 1.72 929.0 Cardio 18.8

971 32 Male 126.4 1.83 198 146 62 1.10 883.0 HIIT 28.2

972 46 Male 88.7 1.63 166 146 66 0.75 542.0 Strength 28.8

973 rows × 15 columns

Next steps: Generate code with Df


toggle_off View recommended plots New interactive sheet

Df.info()

<class 'pandas.core.frame.DataFrame'>
RangeIndex: 973 entries, 0 to 972
Data columns (total 15 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 Age 973 non-null int64
1 Gender 973 non-null object
2 Weight (kg) 973 non-null float64
3 Height (m) 973 non-null float64
4 Max_BPM 973 non-null int64
5 Avg_BPM 973 non-null int64
6 Resting_BPM 973 non-null int64
7 Session_Duration (hours) 973 non-null float64
8 Calories_Burned 973 non-null float64
9 Workout_Type 973 non-null object
10 Fat_Percentage 973 non-null float64
11 Water_Intake (liters) 973 non-null float64
12 Workout_Frequency (days/week) 973 non-null int64
13 Experience_Level 973 non-null int64
14 BMI 973 non-null float64
dtypes: float64(7), int64(6), object(2)
memory usage: 114.1+ KB

Df.dtypes
0

Age int64

Gender object

Weight (kg) float64

Height (m) float64

Max_BPM int64

Avg_BPM int64

Resting_BPM int64

Session_Duration (hours) float64

Calories_Burned float64

Workout_Type object

Fat_Percentage float64

Water_Intake (liters) float64

Workout_Frequency (days/week) int64

Experience_Level int64

BMI float64

dtype: object

Df.describe(exclude='datetime64[ns]')

Weight Height Session_Duration


Age Gender Max_BPM Avg_BPM Resting_BPM Calories_Burned Workout_Type Fa
(kg) (m) (hours)

count 973.000000 973 973.000000 973.00000 973.000000 973.000000 973.000000 973.000000 973.000000 973

unique NaN 2 NaN NaN NaN NaN NaN NaN NaN 4

top NaN Male NaN NaN NaN NaN NaN NaN NaN Strength

freq NaN 511 NaN NaN NaN NaN NaN NaN NaN 258

mean 38.683453 NaN 73.854676 1.72258 179.883864 143.766701 62.223022 1.256423 905.422405 NaN

std 12.180928 NaN 21.207500 0.12772 11.525686 14.345101 7.327060 0.343033 272.641516 NaN

min 18.000000 NaN 40.000000 1.50000 160.000000 120.000000 50.000000 0.500000 303.000000 NaN

25% 28.000000 NaN 58.100000 1.62000 170.000000 131.000000 56.000000 1.040000 720.000000 NaN

50% 40.000000 NaN 70.000000 1.71000 180.000000 143.000000 62.000000 1.260000 893.000000 NaN

75% 49.000000 NaN 86.000000 1.80000 190.000000 156.000000 68.000000 1.460000 1076.000000 NaN

max 59.000000 NaN 129.900000 2.00000 199.000000 169.000000 74.000000 2.000000 1783.000000 NaN

Df.head()

Weight Height Session_Duration Water_Int


Age Gender Max_BPM Avg_BPM Resting_BPM Calories_Burned Workout_Type Fat_Percentage
(kg) (m) (hours) (lite

0 56 Male 88.3 1.71 180 157 60 1.69 1313.0 Yoga 12.6

1 46 Female 74.9 1.53 179 151 66 1.30 883.0 HIIT 33.9

2 32 Female 68.1 1.66 167 122 54 1.11 677.0 Cardio 33.4

3 25 Male 53.2 1.70 190 164 56 0.59 532.0 Strength 28.8

4 38 Male 46.1 1.79 188 158 68 0.64 556.0 Strength 29.2

Next steps: Generate code with Df


toggle_off View recommended plots New interactive sheet

Df.to_csv("newdata.csv")
Df[['Weight (kg)','Resting_BPM']]

Weight (kg) Resting_BPM

0 88.3 60

1 74.9 66

2 68.1 54

3 53.2 56

4 46.1 68

... ... ...

968 87.1 67

969 66.6 56

970 60.4 53

971 126.4 62

972 88.7 66

973 rows × 2 columns

filter=Df[Df['Weight (kg)']>60]

filter

Weight Height Session_Duration Water_I


Age Gender Max_BPM Avg_BPM Resting_BPM Calories_Burned Workout_Type Fat_Percentage
(kg) (m) (hours) (li

0 56 Male 88.3 1.71 180 157 60 1.69 1313.0 Yoga 12.6

1 46 Female 74.9 1.53 179 151 66 1.30 883.0 HIIT 33.9

2 32 Female 68.1 1.66 167 122 54 1.11 677.0 Cardio 33.4

6 36 Male 70.3 1.72 174 169 73 1.49 1385.0 Cardio 21.3

7 40 Female 69.7 1.51 189 141 64 1.27 895.0 Cardio 30.6

... ... ... ... ... ... ... ... ... ... ... ...

968 24 Male 87.1 1.74 187 158 67 1.57 1364.0 Strength 10.0

969 25 Male 66.6 1.61 184 166 56 1.38 1260.0 Strength 25.0

970 59 Female 60.4 1.76 194 120 53 1.72 929.0 Cardio 18.8

971 32 Male 126.4 1.83 198 146 62 1.10 883.0 HIIT 28.2

972 46 Male 88.7 1.63 166 146 66 0.75 542.0 Strength 28.8

686 rows × 15 columns

Next steps: Generate code with filter


toggle_off View recommended plots New interactive sheet

print(filter.shape)
print(Df.shape)

(686, 15)
(973, 15)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy