Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for newer pandas versions #20

Closed
veenstrajelmer opened this issue Feb 28, 2024 · 1 comment
Closed

support for newer pandas versions #20

veenstrajelmer opened this issue Feb 28, 2024 · 1 comment

Comments

@veenstrajelmer
Copy link
Collaborator

veenstrajelmer commented Feb 28, 2024

  • Dddlpy version: latest release
  • Python version: 3.11
  • Operating System: Windows

Description

Trying to use part of the example code from the measurements.ipynb example notebook, but I get "AttributeError: module 'pandas.io.json' has no attribute 'json_normalize'". When I replace pd.io.json.json_normalize with pd.json_normalize the error is avoided. This is probably due to a newer pandas version. When looking back, they replaced normalize.py with _normalize.py from version 0.24.0 to 0.25.0, in 2019 already. Time to move on..

What I Did

import datetime as dt
import ddlpy

locations = ddlpy.locations()
codes = ['WALSODN', 'HOEKVHLD', 'IJMDBTHVN','SCHEVNGN']
parameters = ['WATHTE']
selected = locations[locations.index.isin(codes)]
selected = selected[selected['Grootheid.Code'].isin(parameters)]

# numtiple parameters avaialble per location
records = selected.loc['WALSODN']

# if we pass one row to the measurements function you can get all the measurements
measurements = ddlpy.measurements(records, dt.datetime(2010,1,1), dt.datetime(2011,1,1))
@veenstrajelmer
Copy link
Collaborator Author

Fixed in master branch already

@veenstrajelmer veenstrajelmer closed this as not planned Won't fix, can't repro, duplicate, stale Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant