Skip to content

Add new tutorial video - #6353

Merged
dcherian merged 4 commits into
pydata:mainfrom
dcherian:add-video
Mar 16, 2022
Merged

Add new tutorial video#6353
dcherian merged 4 commits into
pydata:mainfrom
dcherian:add-video

Conversation

@dcherian

Copy link
Copy Markdown
Contributor

No description provided.

@mathause

Copy link
Copy Markdown
Collaborator

Nice! I did not know about coarsen(...).construct(...) - interesting. I usually use set_index for that - could be interesting to test which approach is faster.

def_to_seasonal(ds):
year=ds.time.dt.year.dataseason=ds.time.dt.season.data# assign new coordsds=ds.assign_coords(year=("time", year), season=("time", season))
# reshape the array to (..., "season", "year")returnds.set_index(time=("year", "season")).unstack("time")

@max-sixty

Copy link
Copy Markdown
Collaborator

Very good video @dcherian !

@dcherian
dcherian merged commit 95bb9ae into pydata:mainMar 16, 2022
@dcherian
dcherian deleted the add-video branch March 16, 2022 03:49
@dcherian

Copy link
Copy Markdown
ContributorAuthor

@mathause I suspect coarsen.construct is faster because it's a simple reshape (ignoring the copies associated with handling the boundary condition):

returnvariable.data.reshape(shape), tuple(axes)

Unstacking allocates a new array and then assigns all values. It is definitely the more general solution though.

We should discuss this in the proposed cookbook (#1790)

dcherian added a commit to abel-bzz/xarray that referenced this pull request Mar 18, 2022
* main: (34 commits)
Explicit indexes (pydata#5692)
Remove test_rasterio_vrt_network (pydata#6371)
Allow write_empty_chunks to be set in Zarr encoding (pydata#6348)
Add new tutorial video (pydata#6353)
Revert "explicitly install `ipython_genutils` (pydata#6350)" (pydata#6361)
[pre-commit.ci] pre-commit autoupdate (pydata#6357)
Run pyupgrade on core/groupby (pydata#6351)
Generate reductions for DataArray, Dataset, GroupBy and Resample (pydata#5950)
explicitly install `ipython_genutils` (pydata#6350)
Bump actions/setup-python from 2 to 3 (pydata#6338)
Bump actions/checkout from 2 to 3 (pydata#6337)
In documentation on adding a new backend, add missing import and tweak headings (pydata#6330)
Lengthen underline, correct spelling, and reword (pydata#6326)
quantile: use skipna=None (pydata#6303)
New whatsnew section
v2022.03.0 release notes (pydata#6319)
fix typos (using codespell) (pydata#6316)
Add General issue template (pydata#6314)
Disable CI runs on forks (pydata#6315)
Enable running sphinx-build on Windows (pydata#6237)
...
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@dcherian@mathause@max-sixty