trackintel icon indicating copy to clipboard operation
trackintel copied to clipboard

read staypoints csv function cannot deal with NaNs in finished at

Open NinaWie opened this issue 3 years ago • 1 comments

I used the function read_staypoints_csv to load staypoints of the Foursquare dataset, after I had saved these staypoints before using write_staypoints_csv. The problem with Foursquare is that there is no information about finished_at. When loading the data, the function tries to transform the dataframe into a tz aware dataframe (see here), but it does not work because the values are NaN. This does not cause an error; but the error appears later when running sp.as_staypoints:

AssertionError: dtype of finished_at is datetime64[ns] but has to be tz aware datetime64

I'm not sure how to fix it in Trackintel, but it's not urgent because I use a workaround locally.

NinaWie avatar Jan 05 '22 11:01 NinaWie

We agreed to set the finished at column as an optional column but not to use NaN values for missing finished_at values for now.

henrymartin1 avatar Mar 23 '23 16:03 henrymartin1