We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a4bb7e1 commit 5655571Copy full SHA for 5655571
xarray/core/common.py
@@ -635,6 +635,21 @@ def pipe(
635
else:
636
return func(self, *args, **kwargs)
637
638
+ def apply_to_dataset(self, f):
639
+ from .dataarray import DataArray
640
+
641
+ if isinstance(self, DataArray):
642
+ ds = self._to_temp_dataset()
643
+ else:
644
+ ds = self
645
646
+ result = f(ds)
647
648
649
+ return self._from_temp_dataset(result, name=self.name)
650
651
+ return result
652
653
def groupby(self, group, squeeze: bool = True, restore_coord_dims: bool = None):
654
"""Returns a GroupBy object for performing grouped operations.
655
0 commit comments