write_dataset#

pharmpy.modeling.write_dataset(model, path=None, force=False, type='csv')[source]#

Write dataset to file and updates the datainfo path

Curretly supports csv files.

Parameters:
  • model (Model) – Pharmpy model

  • path (None or str or Path) – Destination path. Default is to use original path with .csv suffix.

  • force (bool) – Overwrite file with same path. Default is False.

  • type (str) – Can only be csv

Returns:

Model – Updated Pharmpy model

Examples

>>> from pharmpy.modeling import load_example_model, write_dataset
>>> model = load_example_model("pheno")
>>> model = write_dataset(model, path="newdataset.csv")