PedestrianDynamics / PedPy

Analysis of pedestrian dynamics based on trajectory files.
https://pedpy.readthedocs.io
MIT License
15 stars 9 forks source link

compute_mean_speed_per_frame return a pandas.series instead of a pandas.dataframe #362

Open ThoChat opened 1 week ago

chraibi commented 1 week ago

Should we convert it to DataFrame?

df_mean_df = df_mean.reset_index()
df_mean_df.columns = [FRAME_COL, 'mean_speed']
ThoChat commented 1 week ago

That's what I did in my code but I think it's worth looking at the code see if this fix is appropriate

schroedtert commented 2 days ago

Just a reminder, changing the return type is a breaking change. If you want to change the return type, the old should still be available.

But why do you want to have a dataframe? It only consists of an index (frame) and a value, this is the use case for series

chraibi commented 2 days ago

Because the documentation of the function says that it returns a dataframe.

schroedtert commented 2 days ago

The documentation seems to be off in this case. I suggest checking what the other functions return, from the documentation DataFrame but I guess there might be some other Series hidden.

chraibi commented 2 days ago

I'll check this and I think it's better to change the documentation than to add breaking code changes