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

Function test_dataframe_iterrows

dask/dataframe/tests/test_dataframe.py:3394–3409  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3392
3393
3394def test_dataframe_iterrows():
3395 df = pd.DataFrame({"x": [1, 2, 3, 4], "y": [10, 20, 30, 40]})
3396 ddf = dd.from_pandas(df, npartitions=2)
3397
3398 if PANDAS_GE_320:
3399 # pandas 3.2 deprecated DataFrame.iterrows. Dask yields from the pandas
3400 # implementation, so the warning must surface rather than be suppressed.
3401 from pandas.errors import Pandas4Warning
3402
3403 ctx = pytest.warns(Pandas4Warning, match="iterrows is deprecated")
3404 else:
3405 ctx = contextlib.nullcontext()
3406
3407 with ctx:
3408 for a, b in zip(df.iterrows(), ddf.iterrows()):
3409 tm.assert_series_equal(a[1], b[1])
3410
3411
3412def test_dataframe_itertuples():

Callers

nothing calls this directly

Calls 1

iterrowsMethod · 0.95

Tested by

no test coverage detected