-
Notifications
You must be signed in to change notification settings - Fork 0
/
datahandler.py
35 lines (22 loc) · 857 Bytes
/
datahandler.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import pandas as pd
df = pd.read_csv('data.csv')
def repMaxList(lift:str)-> list:
filtered_df = df[df.iloc[:, 2] == lift]
weightReps = filtered_df.iloc[:, 3:5].values.tolist()
# Reverse the lists so that the newest data is first
weightReps = weightReps[::-1]
formattedData = []
for index, value in enumerate(weightReps):
# NaN Check
if repMax(value) == repMax(value):
formattedData.append(repMax(value))
return formattedData
def dateList(lift:str)-> list:
filtered_df = df[df.iloc[:, 2] == lift]
date = filtered_df.iloc[:, 0].values.tolist()
# Reverse the lists so that the newest data is first
date = date[::-1]
return date
def repMax(weightReps:list)->int:
return (0.033 * weightReps[0] * weightReps[1]) + weightReps[0]
print(dateList('Bench Press'))