def test_BytesIO_input(self):
if not compat.PY3:
raise nose.SkipTest(
"Bytes-related test - only needs to work on Python 3")
result = pd.read_fwf(BytesIO("????\n????".encode('utf8')), widths=[
2, 2], encoding='utf8')
expected = pd.DataFrame([["??", "??"]], columns=["??", "??"])
tm.assert_frame_equal(result, expected)
data = BytesIO("????::1234\n562::123".encode('cp1255'))
result = pd.read_table(data, sep="::", engine='python',
encoding='cp1255')
expected = pd.DataFrame([[562, 123]], columns=["????", "1234"])
tm.assert_frame_equal(result, expected)
test_parsers.py 文件源码
python
阅读 33
收藏 0
点赞 0
评论 0
评论列表
文章目录