imod.ipf.save#

imod.ipf.save(path, df, itype=None, assoc_ext='txt', nodata=1e+20, assoc_columns=None)[source]#

Saves the contents of a pandas DataFrame to one or more IPF files, and associated (TXT) files.

Can write multiple IPF files if one of the columns is named “layer”. In turn, multiple associated (TXT) files may written for each of these IPF files.

Parameters
  • path (pathlib.Path or str) – path of the written IPF file. Any associated files are written relative to this path, based on the ID column.

  • df (pandas.DataFrame) – DataFrame containing the data to write.

  • itype (int or str or None) –

    IPF type. Defaults to None, in which case no associated files are created. Possible other values, either integer or string:

    • 1 or "timeseries"

    • 2 or "borehole1d"

    • 3 or "cpt"

    • 4 or "borehole3d"

  • assoc_ext (str) – Extension of the associated files. Defaults to “txt”.

  • nodata (float) – The value given to nodata values. These are generally NaN (Not-a-Number) in pandas, but this leads to errors in iMOD(FLOW) for IDFs. Defaults to value of 1.0e20 instead.

  • assoc_columns (optional, list or dict) – Columns to store in the associated file. In case of a dictionary, the columns will be renamed according to the mapping in the dictionary. Defaults to None.

Returns

Writes files.

Return type

None