diff --git a/forest/jasmine/traj2stats.py b/forest/jasmine/traj2stats.py index 0e7fdfd1..877d2477 100644 --- a/forest/jasmine/traj2stats.py +++ b/forest/jasmine/traj2stats.py @@ -388,6 +388,16 @@ def gps_summaries( res += [0] * (2 * len(places_of_interest) + 1) summary_stats.append(res) continue + elif sum(index_rows) == 0 and not split_day_night: + ## There is no data and it is daily data, so we need to add empty rows + res = [year, month, day] + [0] * 3 + [pd.NA] * 15 + + if places_of_interest is not None: + # add empty data for places of interest + # for daytime/nighttime + other + res += [0] * (2 * len(places_of_interest) + 1) + summary_stats.append(res) + continue temp = traj[index_rows, :] # take a subset which is exactly one hour/day, diff --git a/forest/willow/log_stats.py b/forest/willow/log_stats.py index d931bf30..aae5fd82 100644 --- a/forest/willow/log_stats.py +++ b/forest/willow/log_stats.py @@ -143,7 +143,7 @@ def text_analysis( def text_and_call_analysis( df_call: pd.DataFrame, df_text: pd.DataFrame, stamp: int, step_size: int ) -> tuple: - """Calculate the summary statistics for the call data + """Calculate the summary statistics for the call and text data in the given time interval. Args: