data_baseIOLoaderDumperutilsset_object_meta

set_object_meta

data_base.IO.LoaderDumper.utils.set_object_meta(obj, meta)

Reset the dtypes of the columns and index of an object to the original dtypes.

Reads in the object meta from the same savedir and tries to assign the correct dtypes to columns and index.

Parameters:
  • obj – The object to reset the dtypes of.

  • meta (pd.DataFrame) – metadata for the object, containing only column names and the index with correct dtypes.

Returns:

None. Adapts the original object.

Raises:
  • AssertionError – If the object is not a pandas DataFrame, pandas Series, or dask DataFrame.

  • AssertionError – If no meta information is provided.