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

Method drop_dims

xarray/core/coordinates.py:803–826  ·  view source on GitHub ↗

Drop dimensions and associated variables from this dataset. Parameters ---------- drop_dims : str or Iterable of Hashable Dimension or dimensions to drop. errors : {"raise", "ignore"}, default: "raise" If 'raise', raises a ValueError error if

(
        self,
        drop_dims: str | Iterable[Hashable],
        *,
        errors: ErrorOptions = "raise",
    )

Source from the content-addressed store, hash-verified

801 return cast(Self, self.to_dataset().drop_vars(names, errors=errors).coords)
802
803 def drop_dims(
804 self,
805 drop_dims: str | Iterable[Hashable],
806 *,
807 errors: ErrorOptions = "raise",
808 ) -> Self:
809 """Drop dimensions and associated variables from this dataset.
810
811 Parameters
812 ----------
813 drop_dims : str or Iterable of Hashable
814 Dimension or dimensions to drop.
815 errors : {"raise", "ignore"}, default: "raise"
816 If 'raise', raises a ValueError error if any of the
817 dimensions passed are not in the dataset. If 'ignore', any given
818 dimensions that are in the dataset are dropped and no error is raised.
819
820 Returns
821 -------
822 obj : Coordinates
823 Coordinates object without the given dimensions (or any coordinates
824 containing those dimensions).
825 """
826 return cast(Self, self.to_dataset().drop_dims(drop_dims, errors=errors).coords)
827
828 def rename_dims(
829 self,

Callers 1

test_drop_dimsMethod · 0.95

Calls 1

to_datasetMethod · 0.95

Tested by 1

test_drop_dimsMethod · 0.76