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 the feather file is saved.
index (str | int | list | None) – Index number or name 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 the console; defaults to
False
.prt_kwargs (dict | None) – [Optional] Additional parameters for the function
pyhelpers.store.ldr._check_loading_path()
; defaults toNone
.kwargs –
[Optional] Additional parameters for the function pandas.read_feather():
columns
: Sequence of column names to read. IfNone
, all columns are read.use_threads
: Whether to parallelize reading using multiple threads; defaults toTrue
.
- Returns:
Data retrieved from the specified path
path_to_file
.- Return type:
pandas.DataFrame
Note
Example data can be referred to in the function
save_feather()
.
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