TUM-VT/FleetPy

Update pandas command for Pandas 2

Opened this issue · 2 comments

It seems the current future warning is mainly for the following two:
FutureWarning: The squeeze argument has been deprecated and will be removed in a future version. Append .squeeze("columns") to the call to squeeze.
FutureWarning: iteritems is deprecated and will be removed in a future version. Use .items instead.

Pandas 2 should be significantly faster than Pandas 1, so probably it would be worth the efforts.

These are the specific changes that have to be made in the code to make it suit to current numpy and pandas versions:

  • iteritems() -> items() [in TravelerModels.py and NetworkBasic.py]

  • pd.read_csv(f, index_col=0, squeeze=True) -> pd.read_csv(f, index_col=0).squeeze() [in Standard.py, Config.py, Vehicles.py ]

  • Change np.float to float. tts = np.zeros((N_targets,), dtype=np.float) -> tts = np.zeros((N_targets,), dtype=float [In PyNetwork.pyx]. Important, this change will affect only the .pyx file but not the already-compiled version. Therefore, if you already had Fleetpy in the device, you need to compile the cpprouter again after this.