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

Function test_encoding

pandas/tests/io/pytables/test_file_handling.py:307–316  ·  view source on GitHub ↗
(temp_hdfstore)

Source from the content-addressed store, hash-verified

305 not is_platform_little_endian(), reason="reason platform is not little endian"
306)
307def test_encoding(temp_hdfstore):
308 df = DataFrame({"A": "foo", "B": "bar"}, index=range(5))
309 df.loc[2, "A"] = np.nan
310 df.loc[3, "B"] = np.nan
311 temp_hdfstore.append("df", df, encoding="ascii")
312 tm.assert_frame_equal(temp_hdfstore["df"], df)
313
314 expected = df.reindex(columns=["A"])
315 result = temp_hdfstore.select("df", Term("columns=A", encoding="ascii"))
316 tm.assert_frame_equal(result, expected)
317
318
319@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 5

reindexMethod · 0.95
DataFrameClass · 0.90
TermClass · 0.90
appendMethod · 0.45
selectMethod · 0.45

Tested by

no test coverage detected