(pdf)
| 502 | |
| 503 | |
| 504 | def test_memory_usage(pdf): |
| 505 | # Results are not equal with RangeIndex because pandas has one RangeIndex while |
| 506 | # we have one RangeIndex per partition |
| 507 | pdf.index = np.arange(len(pdf)) |
| 508 | df = from_pandas(pdf) |
| 509 | assert_eq(df.memory_usage(), pdf.memory_usage()) |
| 510 | assert_eq(df.memory_usage(index=False), pdf.memory_usage(index=False)) |
| 511 | assert_eq(df.x.memory_usage(), pdf.x.memory_usage()) |
| 512 | assert_eq(df.x.memory_usage(index=False), pdf.x.memory_usage(index=False)) |
| 513 | assert_eq(df.index.memory_usage(), pdf.index.memory_usage()) |
| 514 | with pytest.raises(TypeError, match="got an unexpected keyword"): |
| 515 | df.index.memory_usage(index=True) |
| 516 | |
| 517 | |
| 518 | @pytest.mark.parametrize("func", [M.nlargest, M.nsmallest]) |
nothing calls this directly
no test coverage detected