jade.utils.dataframe_utils.write_dataframe

jade.utils.dataframe_utils.write_dataframe(df, file_path, compress=False, keep_original=False, **kwargs)[source]

Write the dataframe to a file with in a format matching the extension.

Note that the feather and h5 formats do not support row indices. Index columns will be lost for those formats. If the dataframe has an index then it should be converted to a column before calling this function.

This function only supports storing a single dataframe inside an HDF5 file. It always uses the key ‘data’.

Parameters:
  • df (pd.DataFrame)

  • file_path (str)

  • compress (bool)

  • keep_original (bool)

  • kwargs (pass keyword arguments to underlying library)

Raises:
  • InvalidParameter if the file extension is not supported.

  • InvalidParameter if the DataFrame index is set.