MCPcopy Index your code
hub / github.com/pydata/xarray / drop_attrs

Method drop_attrs

xarray/core/dataarray.py:7724–7744  ·  view source on GitHub ↗

Removes all attributes from the DataArray. Parameters ---------- deep : bool, default True Removes attributes from coordinates. Returns ------- DataArray

(self, *, deep: bool = True)

Source from the content-addressed store, hash-verified

7722 str = utils.UncachedAccessor(StringAccessor["DataArray"])
7723
7724 def drop_attrs(self, *, deep: bool = True) -> Self:
7725 """
7726 Removes all attributes from the DataArray.
7727
7728 Parameters
7729 ----------
7730 deep : bool, default True
7731 Removes attributes from coordinates.
7732
7733 Returns
7734 -------
7735 DataArray
7736 """
7737 if not deep:
7738 return self._replace(attrs={})
7739 else:
7740 return (
7741 self._to_temp_dataset()
7742 .drop_attrs(deep=deep)
7743 .pipe(self._from_temp_dataset)
7744 )

Callers

nothing calls this directly

Calls 3

_replaceMethod · 0.95
_to_temp_datasetMethod · 0.95
pipeMethod · 0.45

Tested by

no test coverage detected