ArtesiaWater / hydropandas

Module for loading observation data into custom DataFrames
https://hydropandas.readthedocs.io
MIT License
52 stars 10 forks source link

Pandas updates and `get_obs` method #190

Closed OnnoEbbens closed 4 months ago

OnnoEbbens commented 4 months ago

some fixes for future warnings in Pandas and a new method to get an observation from a collection.

Previously if you wanted to get an observation from a collection you had to do:

# select by name
o = oc.loc['name', 'obs']
# select by properties
o = oc.loc[(oc['monitoring_well'] == 'GMW001234'] & oc['tube_nr'] == 1]), 'obs'].values[0]

With the new method you can do:

# select by name
o = oc.get_obs(name)
# select by properties
o = oc.get_obs(monitoring_well='GMW001234', tube_nr=1)

The old way still works, so no backward compatibility issues.