my.body.sleep: fix issue with attaching temperature
seems that the index operator only works when boundaries are in the dataframe
This commit is contained in:
parent
444ec1c450
commit
ed23661468
1 changed files with 2 additions and 1 deletions
|
@ -23,8 +23,9 @@ class Combine:
|
|||
if pd.isna(start) or pd.isna(end):
|
||||
return None
|
||||
|
||||
between = (start <= temp.index) & (temp.index <= end)
|
||||
# on no temp data, returns nan, ok
|
||||
return temp[start: end].mean()
|
||||
return temp[between].mean()
|
||||
|
||||
df['avg_temp'] = df.apply(calc_avg_temperature, axis=1)
|
||||
return df
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue