MCPcopy
hub / github.com/pydata/xarray / test_to_and_from_empty_series

Method test_to_and_from_empty_series

xarray/tests/test_dataarray.py:3886–3893  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3884 assert not hasattr(array, "nbytes")
3885
3886 def test_to_and_from_empty_series(self) -> None:
3887 # GH697
3888 expected: pd.Series[Any] = pd.Series([], dtype=np.float64)
3889 da = DataArray.from_series(expected)
3890 assert len(da) == 0
3891 actual = da.to_series()
3892 assert len(actual) == 0
3893 assert expected.equals(actual)
3894
3895 def test_series_categorical_index(self) -> None:
3896 # regression test for GH700

Callers

nothing calls this directly

Calls 3

from_seriesMethod · 0.80
to_seriesMethod · 0.80
equalsMethod · 0.45

Tested by

no test coverage detected