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

Method _to_dense

xarray/namedarray/core.py:995–1003  ·  view source on GitHub ↗

Change backend from sparse to np.array.

(self)

Source from the content-addressed store, hash-verified

993 return self._new(data=data)
994
995 def _to_dense(self) -> NamedArray[Any, _DType_co]:
996 """
997 Change backend from sparse to np.array.
998 """
999 if isinstance(self._data, _sparsearrayfunction_or_api):
1000 data_dense: np.ndarray[Any, _DType_co] = self._data.todense()
1001 return self._new(data=data_dense)
1002 else:
1003 raise TypeError("self.data is not a sparse array")
1004
1005 def permute_dims(
1006 self,

Callers

nothing calls this directly

Calls 2

_newMethod · 0.95
todenseMethod · 0.45

Tested by

no test coverage detected