当前位置: 首页>>代码示例>>Python>>正文


Python testing.round_trip_pathlib方法代码示例

本文整理汇总了Python中pandas.util.testing.round_trip_pathlib方法的典型用法代码示例。如果您正苦于以下问题:Python testing.round_trip_pathlib方法的具体用法?Python testing.round_trip_pathlib怎么用?Python testing.round_trip_pathlib使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pandas.util.testing的用法示例。


在下文中一共展示了testing.round_trip_pathlib方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_path_pathlib

# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import round_trip_pathlib [as 别名]
def test_path_pathlib(self):
        df = tm.makeDataFrame()
        df.index.name = 'index'
        reader = lambda x: read_stata(x).set_index('index')
        result = tm.round_trip_pathlib(df.to_stata, reader)
        tm.assert_frame_equal(df, result) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:8,代码来源:test_stata.py

示例2: test_path_path_lib

# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import round_trip_pathlib [as 别名]
def test_path_path_lib(all_parsers):
    parser = all_parsers
    df = tm.makeDataFrame()
    result = tm.round_trip_pathlib(
        df.to_csv, lambda p: parser.read_csv(p, index_col=0))
    tm.assert_frame_equal(df, result) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:8,代码来源:test_common.py

示例3: test_path_pathlib

# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import round_trip_pathlib [as 别名]
def test_path_pathlib(self):
        df = tm.makeDataFrame().reset_index()
        result = tm.round_trip_pathlib(df.to_feather, pd.read_feather)
        tm.assert_frame_equal(df, result) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:6,代码来源:test_feather.py

示例4: test_path_path_lib

# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import round_trip_pathlib [as 别名]
def test_path_path_lib(self, merge_cells, engine, ext):
        df = tm.makeDataFrame()
        writer = partial(df.to_excel, engine=engine)

        reader = partial(pd.read_excel, index_col=0)
        result = tm.round_trip_pathlib(writer, reader,
                                       path="foo.{ext}".format(ext=ext))
        tm.assert_frame_equal(result, df) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:10,代码来源:test_excel.py

示例5: test_path_local_path

# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import round_trip_pathlib [as 别名]
def test_path_local_path(self, merge_cells, engine, ext):
        df = tm.makeDataFrame()
        writer = partial(df.to_excel, engine=engine)

        reader = partial(pd.read_excel, index_col=0)
        result = tm.round_trip_pathlib(writer, reader,
                                       path="foo.{ext}".format(ext=ext))
        tm.assert_frame_equal(result, df) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:10,代码来源:test_excel.py

示例6: test_path_pathlib

# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import round_trip_pathlib [as 别名]
def test_path_pathlib(self):
        df = tm.makeDataFrame()
        result = tm.round_trip_pathlib(df.to_msgpack, read_msgpack)
        tm.assert_frame_equal(df, result) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:6,代码来源:test_packers.py

示例7: test_path_pathlib

# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import round_trip_pathlib [as 别名]
def test_path_pathlib(self):
        df = tm.makeDataFrame()
        result = tm.round_trip_pathlib(df.to_csv,
                                       lambda p: self.read_csv(p, index_col=0))
        tm.assert_frame_equal(df, result) 
开发者ID:birforce,项目名称:vnpy_crypto,代码行数:7,代码来源:common.py

示例8: test_path_pathlib

# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import round_trip_pathlib [as 别名]
def test_path_pathlib(self, merge_cells, engine, ext):
        df = tm.makeDataFrame()
        writer = partial(df.to_excel, engine=engine)
        reader = partial(pd.read_excel)
        result = tm.round_trip_pathlib(writer, reader,
                                       path="foo.{}".format(ext))
        tm.assert_frame_equal(df, result) 
开发者ID:birforce,项目名称:vnpy_crypto,代码行数:9,代码来源:test_excel.py

示例9: test_path_localpath

# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import round_trip_pathlib [as 别名]
def test_path_localpath(self, merge_cells, engine, ext):
        df = tm.makeDataFrame()
        writer = partial(df.to_excel, engine=engine)
        reader = partial(pd.read_excel)
        result = tm.round_trip_pathlib(writer, reader,
                                       path="foo.{}".format(ext))
        tm.assert_frame_equal(df, result) 
开发者ID:birforce,项目名称:vnpy_crypto,代码行数:9,代码来源:test_excel.py

示例10: test_path_pathlib

# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import round_trip_pathlib [as 别名]
def test_path_pathlib(self):
        df = tm.makeDataFrame()
        writer = partial(df.to_excel, engine=self.engine_name)
        reader = partial(pd.read_excel)
        result = tm.round_trip_pathlib(writer, reader,
                                       path="foo.{}".format(self.ext))
        tm.assert_frame_equal(df, result) 
开发者ID:securityclippy,项目名称:elasticintel,代码行数:9,代码来源:test_excel.py

示例11: test_path_localpath

# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import round_trip_pathlib [as 别名]
def test_path_localpath(self):
        df = tm.makeDataFrame()
        writer = partial(df.to_excel, engine=self.engine_name)
        reader = partial(pd.read_excel)
        result = tm.round_trip_pathlib(writer, reader,
                                       path="foo.{}".format(self.ext))
        tm.assert_frame_equal(df, result) 
开发者ID:securityclippy,项目名称:elasticintel,代码行数:9,代码来源:test_excel.py


注:本文中的pandas.util.testing.round_trip_pathlib方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。