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

Function test_getitem_integer_slice

dask/dataframe/tests/test_indexing.py:295–315  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

293
294
295def test_getitem_integer_slice():
296 df = pd.DataFrame({"A": range(6)})
297 ddf = dd.from_pandas(df, 2)
298 # integer slicing is iloc based
299 with pytest.raises(NotImplementedError):
300 ddf[1:3]
301
302 df = pd.DataFrame({"A": range(6)}, index=[1.0, 2.0, 3.0, 5.0, 10.0, 11.0])
303 ddf = dd.from_pandas(df, 2)
304 # except for float dtype indexes
305 ctx = contextlib.nullcontext()
306 if PANDAS_GE_210 and not PANDAS_GE_300:
307 ctx = pytest.warns(FutureWarning, match="float-dtype index")
308 elif PANDAS_GE_300:
309 ctx = pytest.raises(NotImplementedError)
310 with ctx:
311 assert_eq(ddf[2:8], df[2:8])
312 with ctx:
313 assert_eq(ddf[2:], df[2:])
314 with ctx:
315 assert_eq(ddf[:8], df[:8])
316
317
318def test_loc_on_numpy_datetimes():

Callers

nothing calls this directly

Calls 1

assert_eqFunction · 0.90

Tested by

no test coverage detected