Skip to content

Commit

Permalink
Add individual PAS durations
Browse files Browse the repository at this point in the history
  • Loading branch information
sho-87 committed Aug 11, 2020
1 parent 211b8be commit c012212
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions pyutils_sh/survey.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,16 +373,16 @@ def pas_aggregate(q_map):

for letter in string.ascii_lowercase[:9]:
# time conversion
df["{}_met_hours".format(letter)] = (
df["{}_hours".format(letter)] = (
q_map["{}_hours".format(letter)].astype(float)
+ q_map["{}_mins".format(letter)].astype(float) / 60
)

# multiply mets
df["{}_met_hours".format(letter)] *= mets[letter]
df["{}_met_hours".format(letter)] = df["{}_hours".format(letter)] * mets[letter]

df["total_met_hours"] = df.sum(axis=1)
df["total_hours"] = df.filter(regex="^.{1}_hours$").sum(axis=1)
df["total_met_hours"] = df.filter(regex="^.{1}_met_hours$").sum(axis=1)
df["sub_num"] = q_map["sub_num"].astype(int)

return df

2 changes: 1 addition & 1 deletion pyutils_sh/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.5.3"
__version__ = "1.6.0"

0 comments on commit c012212

Please sign in to comment.