Replace [] with 0 for mostcommonactivity of GAR sensor

pull/95/head
Meng Li 2020-03-09 13:54:28 -04:00
parent aba9f13332
commit 490ff43fbf
1 changed files with 1 additions and 1 deletions

View File

@ -36,7 +36,7 @@ else:
#Finding most common activity of the day #Finding most common activity of the day
if("mostcommonactivity" in metrics): if("mostcommonactivity" in metrics):
finalDataset["ar_" + str(day_segment) + "_mostcommonactivity"] = resampledData['activity_type'].resample('D').apply(lambda x:stats.mode(x)[0]) finalDataset["ar_" + str(day_segment) + "_mostcommonactivity"] = resampledData['activity_type'].resample('D').apply(lambda x: stats.mode(x)[0] if len(stats.mode(x)[0]) != 0 else None)
#finding different number of activities during a day #finding different number of activities during a day
if("countuniqueactivities" in metrics): if("countuniqueactivities" in metrics):