def test_read_one_empty_col_no_header(self):
df = pd.DataFrame(
[["", 1, 100],
["", 2, 200],
["", 3, 300],
["", 4, 400]]
)
with ensure_clean(self.ext) as path:
df.to_excel(path, 'no_header', index=False, header=False)
actual_header_none = read_excel(
path,
'no_header',
parse_cols=[0],
header=None
)
actual_header_zero = read_excel(
path,
'no_header',
parse_cols=[0],
header=0
)
expected = DataFrame()
tm.assert_frame_equal(actual_header_none, expected)
tm.assert_frame_equal(actual_header_zero, expected)
test_excel.py 文件源码
python
阅读 36
收藏 0
点赞 0
评论 0
评论列表
文章目录