, 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. Note that the ID must be unique for each layer. See the examples.

  • 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.


Writes files.

Return type:



To write a single IPF without associated timeseries or boreholes:

>>>"static-data.ipf", df)

To write timeseries data:

>>>"transient-data.ipf", df, itype="timeseries")

If a "layer" column is present, make sure the ID is unique per layer:

>>> df["id"] = df["id"]["layer"], sep="_")
>>>"layered.ipf", df, itype="timeseries")

An error will be raised otherwise.