trackintel icon indicating copy to clipboard operation
trackintel copied to clipboard

List of trip ids in a tour dataframe is unstructured when reading it from postgis.

Open henrymartin1 opened this issue 2 years ago • 0 comments

Tours store a list of the trips they aggregate in the field "trips". Unfortunately the datatype of this list is not stable when writing+reading it from a postgis database. In this case it is transformed to a string of a dictionary, e.g., '{72066,72067,72068,72069,72070}' It would be great if the trackintel reading/writing functions could somehow handle this. If there is no better way, the read tours from postgis function could include a line like this to parse the field properly: tours["trips"] = tours["trips"].apply(lambda x: eval(x.replace("{", "[").replace("}", "]")))

henrymartin1 avatar Jul 28 '22 22:07 henrymartin1