test_io.py 文件源码

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

项目:deliver 作者: orchestor 项目源码 文件源码
def test_recfromcsv(self):
        with temppath(suffix='.txt') as path:
            path = Path(path)
            with path.open('w') as f:
                f.write(u'A,B\n0,1\n2,3')

            kwargs = dict(missing_values="N/A", names=True, case_sensitive=True)
            test = np.recfromcsv(path, dtype=None, **kwargs)
            control = np.array([(0, 1), (2, 3)],
                               dtype=[('A', np.int), ('B', np.int)])
            self.assertTrue(isinstance(test, np.recarray))
            assert_equal(test, control)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号