test_parsers.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:PyDataLondon29-EmbarrassinglyParallelDAWithAWSLambda 作者: SignalMedia 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号