lab task 8 .ipynb - Colab
lab task 8 .ipynb - Colab
Df=pd.read_csv('/content/gym_members_exercise_tracking.csv')
Df
... ... ... ... ... ... ... ... ... ... ... ...
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
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
Max_BPM int64
Avg_BPM int64
Resting_BPM int64
Calories_Burned float64
Workout_Type object
Fat_Percentage float64
Experience_Level int64
BMI float64
dtype: object
Df.describe(exclude='datetime64[ns]')
count 973.000000 973 973.000000 973.00000 973.000000 973.000000 973.000000 973.000000 973.000000 973
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()
Df.to_csv("newdata.csv")
Df[['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
filter=Df[Df['Weight (kg)']>60]
filter
... ... ... ... ... ... ... ... ... ... ... ...
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
print(filter.shape)
print(Df.shape)
(686, 15)
(973, 15)