load_joblib

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

Load data from a Joblib file.

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

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

  • prt_kwargs (dict | None) – [Optional] addtional parameters for the function pyhelpers.store._check_loading_path(); defaults to None.

  • kwargs – [Optional] addtional parameters for the function joblib.load().

Returns:

Data retrieved from the specified path path_to_file.

Return type:

Any

Note

Examples:

>>> from pyhelpers.store import load_joblib
>>> from pyhelpers.dirs import cd
>>> joblib_pathname = cd("tests\data", "dat.joblib")
>>> joblib_dat = load_joblib(joblib_pathname, verbose=True)
Loading "tests\data\dat.joblib" ... Done.
>>> joblib_dat
array([[0.5488135 , 0.71518937, 0.60276338, ..., 0.02010755, 0.82894003,
        0.00469548],
       [0.67781654, 0.27000797, 0.73519402, ..., 0.25435648, 0.05802916,
        0.43441663],
       [0.31179588, 0.69634349, 0.37775184, ..., 0.86219152, 0.97291949,
        0.96083466],
       ...,
       [0.89111234, 0.26867428, 0.84028499, ..., 0.5736796 , 0.73729114,
        0.22519844],
       [0.26969792, 0.73882539, 0.80714479, ..., 0.94836806, 0.88130699,
        0.1419334 ],
       [0.88498232, 0.19701397, 0.56861333, ..., 0.75842952, 0.02378743,
        0.81357508]])