MCPcopy
hub / github.com/pandas-dev/pandas / test_pickle_buffer_roundtrip

Function test_pickle_buffer_roundtrip

pandas/tests/io/test_pickle.py:434–445  ·  view source on GitHub ↗
(temp_file)

Source from the content-addressed store, hash-verified

432
433
434def test_pickle_buffer_roundtrip(temp_file):
435 path = temp_file
436 df = DataFrame(
437 1.1 * np.arange(120).reshape((30, 4)),
438 columns=Index(list("ABCD"), dtype=object),
439 index=Index([f"i-{i}" for i in range(30)], dtype=object),
440 )
441 with open(path, "wb") as fh:
442 df.to_pickle(fh)
443 with open(path, "rb") as fh:
444 result = pd.read_pickle(fh)
445 tm.assert_frame_equal(df, result)
446
447
448def test_pickle_fsspec_roundtrip(temp_file):

Callers

nothing calls this directly

Calls 4

DataFrameClass · 0.90
IndexClass · 0.90
to_pickleMethod · 0.80
reshapeMethod · 0.45

Tested by

no test coverage detected