kuanb / peartree

peartree: A library for converting transit data into a directed graph for sketch network analysis.
MIT License
201 stars 23 forks source link

More explicit handling of series conversion in wait time generation #95

Closed kuanb closed 6 years ago

kuanb commented 6 years ago

In wait time generation, we expect a series returned during the following summarize operation: https://github.com/kuanb/peartree/blob/b1e8677c8af89e5f37c203116706cc4fe9365603/peartree/summarizer.py#L139-L142

In that step, we extract the summarized values and effectively convert that series to a dataframe. Unfortunately, there are edges cases where an empty result is returned. When empty, the group by returns an empty dataframe. This causes a value error on the columns reset. Let's handle this more explicitly by extracting series value as expected.