Python pandas.util.testing.round_trip_pathlib() Examples

The following are 27 code examples of pandas.util.testing.round_trip_pathlib(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module pandas.util.testing , or try the search function .
Example #1
Source File: test_common.py    From predictive-maintenance-using-machine-learning with Apache License 2.0 5 votes vote down vote up
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) 
Example #2
Source File: test_feather.py    From twitter-stock-recommendation with MIT License 5 votes vote down vote up
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) 
Example #3
Source File: common.py    From twitter-stock-recommendation with MIT License 5 votes vote down vote up
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) 
Example #4
Source File: test_stata.py    From twitter-stock-recommendation with MIT License 5 votes vote down vote up
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) 
Example #5
Source File: test_packers.py    From elasticintel with GNU General Public License v3.0 5 votes vote down vote up
def test_path_pathlib(self):
        df = tm.makeDataFrame()
        result = tm.round_trip_pathlib(df.to_msgpack, read_msgpack)
        tm.assert_frame_equal(df, result) 
Example #6
Source File: test_excel.py    From elasticintel with GNU General Public License v3.0 5 votes vote down vote up
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) 
Example #7
Source File: test_excel.py    From elasticintel with GNU General Public License v3.0 5 votes vote down vote up
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) 
Example #8
Source File: test_feather.py    From elasticintel with GNU General Public License v3.0 5 votes vote down vote up
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) 
Example #9
Source File: common.py    From elasticintel with GNU General Public License v3.0 5 votes vote down vote up
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) 
Example #10
Source File: test_stata.py    From elasticintel with GNU General Public License v3.0 5 votes vote down vote up
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) 
Example #11
Source File: test_packers.py    From predictive-maintenance-using-machine-learning with Apache License 2.0 5 votes vote down vote up
def test_path_pathlib(self):
        df = tm.makeDataFrame()
        result = tm.round_trip_pathlib(df.to_msgpack, read_msgpack)
        tm.assert_frame_equal(df, result) 
Example #12
Source File: test_excel.py    From predictive-maintenance-using-machine-learning with Apache License 2.0 5 votes vote down vote up
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) 
Example #13
Source File: test_excel.py    From predictive-maintenance-using-machine-learning with Apache License 2.0 5 votes vote down vote up
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) 
Example #14
Source File: test_feather.py    From predictive-maintenance-using-machine-learning with Apache License 2.0 5 votes vote down vote up
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) 
Example #15
Source File: test_stata.py    From recruit with Apache License 2.0 5 votes vote down vote up
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) 
Example #16
Source File: test_stata.py    From predictive-maintenance-using-machine-learning with Apache License 2.0 5 votes vote down vote up
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) 
Example #17
Source File: test_packers.py    From vnpy_crypto with MIT License 5 votes vote down vote up
def test_path_pathlib(self):
        df = tm.makeDataFrame()
        result = tm.round_trip_pathlib(df.to_msgpack, read_msgpack)
        tm.assert_frame_equal(df, result) 
Example #18
Source File: test_excel.py    From vnpy_crypto with MIT License 5 votes vote down vote up
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) 
Example #19
Source File: test_excel.py    From vnpy_crypto with MIT License 5 votes vote down vote up
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) 
Example #20
Source File: test_feather.py    From vnpy_crypto with MIT License 5 votes vote down vote up
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) 
Example #21
Source File: common.py    From vnpy_crypto with MIT License 5 votes vote down vote up
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) 
Example #22
Source File: test_stata.py    From vnpy_crypto with MIT License 5 votes vote down vote up
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) 
Example #23
Source File: test_packers.py    From recruit with Apache License 2.0 5 votes vote down vote up
def test_path_pathlib(self):
        df = tm.makeDataFrame()
        result = tm.round_trip_pathlib(df.to_msgpack, read_msgpack)
        tm.assert_frame_equal(df, result) 
Example #24
Source File: test_excel.py    From recruit with Apache License 2.0 5 votes vote down vote up
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) 
Example #25
Source File: test_excel.py    From recruit with Apache License 2.0 5 votes vote down vote up
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) 
Example #26
Source File: test_feather.py    From recruit with Apache License 2.0 5 votes vote down vote up
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) 
Example #27
Source File: test_common.py    From recruit with Apache License 2.0 5 votes vote down vote up
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)