dronecrew / px4tools

PX4 flight analysis tools.
BSD 3-Clause "New" or "Revised" License
84 stars 48 forks source link

Bug Fix: ValueError in PX4MessageDict.concat #42

Closed wangwwno1 closed 3 years ago

wangwwno1 commented 3 years ago

Situation: The original implementation use TimedeltaIndex as the index of DataFrame. However, the default index name of TimedeltaIndex is "timestamp", which is duplicate with the column index. Using an index that exist in both index and column will raise a ValueError, as pandas cannot infer which axis is the user refer to. For details please refer to issue #40

Solution: In this patch I copy the original DataFrame, set the source index to None before calling the sort_values and merge_asof function. This would resolve the duplication problem without modify the timestamp column index.

wangwwno1 commented 3 years ago

@TSC21 Hello, I just post a PR to fix a bug in ulog concat function, but I don't have the privilege to merge it. Could you review this PR and, if that is OK, merge it into the master branch? Thanks!

jgoppert commented 3 years ago

Thanks! Looks good to me.