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

Utilize new API features in examples #1

Open
bkg opened this issue Mar 15, 2019 · 0 comments
Open

Utilize new API features in examples #1

bkg opened this issue Mar 15, 2019 · 0 comments

Comments

@bkg
Copy link

bkg commented Mar 15, 2019

We can simplify all of the Pandas related usage in the notebooks using some of the latest API features, for example:

url = 'https://api.cal-adapt.org/api/series/pr_day_HadGEM2-ES_rcp85/events/?g=POINT(-121.46+38.59)&imperial=y'
series = pd.read_json(url, typ='series', orient='split')

This instantiates a Series with date index and slug for the name attribute. This will help clean up some of the boilerplate in working with the API, such as unit conversions and requests code.

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