MCPcopy Create free account
hub / github.com/dask/dask / test_map_index

Function test_map_index

dask/dataframe/dask_expr/tests/test_collection.py:271–283  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

269
270
271def test_map_index():
272 df = pd.DataFrame({"x": [1, 2, 3, 4, 5]})
273 ddf = from_pandas(df, npartitions=2)
274 assert ddf.known_divisions is True
275
276 with pytest.warns(UserWarning):
277 cleared = ddf.index.map(lambda x: x * 10)
278 assert cleared.known_divisions is False
279
280 with pytest.warns(UserWarning):
281 applied = ddf.index.map(lambda x: x * 10, is_monotonic=True)
282 assert applied.known_divisions is True
283 assert applied.divisions == tuple(x * 10 for x in ddf.divisions)
284
285
286def test_squeeze():

Callers

nothing calls this directly

Calls 2

from_pandasFunction · 0.90
mapMethod · 0.45

Tested by

no test coverage detected