data_baseutilsdf_colnames_to_str

df_colnames_to_str

data_base.utils.df_colnames_to_str(df)

Convert the column names and index names of a dataframe to string.

Useful for dumping using the pandas_to_parquet dumper, or dask_to_parquet dumper. Warning: This overwrites the original object. This is preferred over the overhead of creating a copy on every write.

Parameters:

df (pd.DataFrame | dask.DataFrame) – a DataFrame

Returns:

the same dataframe, but with string type column and index names.

Return type:

df (pd.DataFrame | dask.DataFrame)