Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
synergy
o3skim
Commits
741e70ab
Commit
741e70ab
authored
Jan 21, 2021
by
BorjaEst
Browse files
Add comment info to groupby_decade
parent
f688f0f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
o3skim/extended_xarray.py
View file @
741e70ab
...
...
@@ -36,6 +36,7 @@ class ModelAccessor:
return
self
.
_model
.
groupby
(
xr
.
DataArray
(
years
))
def
groupby_decade
(
self
):
"""Returns a grouped dataset by decade"""
def
delta_map
(
x
):
return
x
.
year
//
10
*
10
years
=
self
.
_model
.
indexes
[
'time'
].
map
(
delta_map
)
return
self
.
_model
.
groupby
(
xr
.
DataArray
(
years
))
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment