load_feather

pyhelpers.store.load_feather(path_to_file, index=None, verbose=False, prt_kwargs=None, **kwargs)[source]

Load a dataframe from a Feather file.

Parameters:
  • path_to_file (str | os.PathLike) – Path where a feather file is saved.

  • index (str | int | list | None) – Index number of the column(s) to use as the row labels of the dataframe; defaults to None.

  • verbose (bool | int) – Whether to print relevant information in console; defaults to False.

  • prt_kwargs (dict | None) – [Optional] parameters of pyhelpers.store.ldr.__check_loading_path(); defaults to None.

  • kwargs

    [Optional] parameters of pandas.read_feather:

    • columns: a sequence of column names, if None, all columns

    • use_threads: whether to parallelize reading using multiple threads; defaults to True

Returns:

Data retrieved from the specified path path_to_file.

Return type:

pandas.DataFrame

Note

Examples:

>>> from pyhelpers.store import load_feather
>>> from pyhelpers.dirs import cd

>>> feather_path = cd("tests\data", "dat.feather")
>>> feather_dat = load_feather(feather_path, index=0, verbose=True)
Loading "tests\data\dat.feather" ... Done.
>>> feather_dat
            Longitude   Latitude
City
London      -0.127647  51.507322
Birmingham  -1.902691  52.479699
Manchester  -2.245115  53.479489
Leeds       -1.543794  53.797418