本文整理汇总了Python中pandas.util.testing.round_trip_localpath方法的典型用法代码示例。如果您正苦于以下问题:Python testing.round_trip_localpath方法的具体用法?Python testing.round_trip_localpath怎么用?Python testing.round_trip_localpath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pandas.util.testing
的用法示例。
在下文中一共展示了testing.round_trip_localpath方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_pickle_path_localpath
# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import round_trip_localpath [as 别名]
def test_pickle_path_localpath(self):
df = tm.makeDataFrame()
df.index.name = 'index'
reader = lambda x: read_stata(x).set_index('index')
result = tm.round_trip_localpath(df.to_stata, reader)
tm.assert_frame_equal(df, result)
示例2: test_path_local_path
# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import round_trip_localpath [as 别名]
def test_path_local_path(all_parsers):
parser = all_parsers
df = tm.makeDataFrame()
result = tm.round_trip_localpath(
df.to_csv, lambda p: parser.read_csv(p, index_col=0))
tm.assert_frame_equal(df, result)
示例3: test_path_localpath
# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import round_trip_localpath [as 别名]
def test_path_localpath(self):
df = tm.makeDataFrame().reset_index()
result = tm.round_trip_localpath(df.to_feather, pd.read_feather)
tm.assert_frame_equal(df, result)
示例4: test_pickle_path_localpath
# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import round_trip_localpath [as 别名]
def test_pickle_path_localpath():
df = tm.makeDataFrame()
result = tm.round_trip_localpath(df.to_pickle, pd.read_pickle)
tm.assert_frame_equal(df, result)
# ---------------------
# test pickle compression
# ---------------------
示例5: test_path_localpath
# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import round_trip_localpath [as 别名]
def test_path_localpath(self):
df = tm.makeDataFrame()
result = tm.round_trip_localpath(df.to_msgpack, read_msgpack)
tm.assert_frame_equal(df, result)
示例6: test_path_localpath
# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import round_trip_localpath [as 别名]
def test_path_localpath(self):
df = tm.makeDataFrame()
result = tm.round_trip_localpath(
df.to_csv,
lambda p: self.read_csv(p, index_col=0))
tm.assert_frame_equal(df, result)