本文整理汇总了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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)