コード例 #1
0
ファイル: test_writers.py プロジェクト: selik/pandas
    def test_path_local_path(self, engine, ext):
        df = tm.makeDataFrame()
        writer = partial(df.to_excel, engine=engine)

        reader = partial(pd.read_excel, index_col=0)
        result = tm.round_trip_localpath(writer, reader, path=f"foo{ext}")
        tm.assert_frame_equal(result, df)
コード例 #2
0
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
0
ファイル: test_store.py プロジェクト: attack68/pandas
def test_path_localpath_hdfstore(setup_path):
    df = tm.makeDataFrame()

    def writer(path):
        with HDFStore(path) as store:
            df.to_hdf(store, "df")

    def reader(path):
        with HDFStore(path) as store:
            return read_hdf(store, "df")

    result = tm.round_trip_localpath(writer, reader)
    tm.assert_frame_equal(df, result)
コード例 #4
0
ファイル: test_pickle.py プロジェクト: zjfjyc/pandas
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)
コード例 #5
0
 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)