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

Function test_memory_usage

dask/dataframe/dask_expr/tests/test_collection.py:480–491  ·  view source on GitHub ↗
(pdf)

Source from the content-addressed store, hash-verified

478
479
480def test_memory_usage(pdf):
481 # Results are not equal with RangeIndex because pandas has one RangeIndex while
482 # we have one RangeIndex per partition
483 pdf.index = np.arange(len(pdf))
484 df = from_pandas(pdf)
485 assert_eq(df.memory_usage(), pdf.memory_usage())
486 assert_eq(df.memory_usage(index=False), pdf.memory_usage(index=False))
487 assert_eq(df.x.memory_usage(), pdf.x.memory_usage())
488 assert_eq(df.x.memory_usage(index=False), pdf.x.memory_usage(index=False))
489 assert_eq(df.index.memory_usage(), pdf.index.memory_usage())
490 with pytest.raises(TypeError, match="got an unexpected keyword"):
491 df.index.memory_usage(index=True)
492
493
494@pytest.mark.parametrize("func", [M.nlargest, M.nsmallest])

Callers

nothing calls this directly

Calls 4

from_pandasFunction · 0.90
assert_eqFunction · 0.90
arangeMethod · 0.45
memory_usageMethod · 0.45

Tested by

no test coverage detected