當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。