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

Method test_usecols_list

pandas/tests/io/excel/test_readers.py:265–284  ·  view source on GitHub ↗
(self, request, engine, read_ext, df_ref)

Source from the content-addressed store, hash-verified

263 )
264
265 def test_usecols_list(self, request, engine, read_ext, df_ref):
266 xfail_datetimes_with_pyxlsb(engine, request)
267
268 expected = df_ref[["B", "C"]]
269 adjust_expected(expected, read_ext, engine)
270
271 df1 = pd.read_excel(
272 "test1" + read_ext, sheet_name="Sheet1", index_col=0, usecols=[0, 2, 3]
273 )
274 df2 = pd.read_excel(
275 "test1" + read_ext,
276 sheet_name="Sheet2",
277 skiprows=[1],
278 index_col=0,
279 usecols=[0, 2, 3],
280 )
281
282 # TODO add index to xls file)
283 tm.assert_frame_equal(df1, expected)
284 tm.assert_frame_equal(df2, expected)
285
286 def test_usecols_str(self, request, engine, read_ext, df_ref):
287 xfail_datetimes_with_pyxlsb(engine, request)

Callers

nothing calls this directly

Calls 2

adjust_expectedFunction · 0.85

Tested by

no test coverage detected