pyswmm / swmmio

Python tools for interacting with, editing, and visualizing EPA SWMM5 models
https://swmmio.readthedocs.io
MIT License
126 stars 41 forks source link

Passing single label to .loc rather than list of labels. Change deprecated delim_whitespace=True to sep=r'\s+' #224

Open dirwin5 opened 2 months ago

dirwin5 commented 2 months ago

Passing single label to .loc rather than list of labels to return series rather than dataframe. This avoids FutureWarning: calling float on single element series and FutureWarning: Series.getitem treating keys as positions is deprecated.

Changed deprecated delim_whitespace=True to sep=r'\s+'.

Changed '\s+' to r'\s+' to remove invalid escape sequence '\s' warning.

bemcdonnell commented 2 months ago

@dirwin5, are these changes friendly with pandas<2? When it comes to major upgrades in dependencies, we are always very careful and strategic as to not force everyone to upgrade straight-away. We can always do a quick test on that with the requirements file.

dirwin5 commented 2 months ago

Hi @bemcdonnell, I believe they won't break pandas<2. I ran the all the tests with pandas 1.4.0 and numpy 1.21.0 and they all passed.