write_csv#

pharmpy.modeling.write_csv(model, path=None, force=False)[source]#

Write dataset to a csv file and updates the datainfo path

Parameters:
  • model (Model) – Model whose dataset to write to file

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

Returns:

Model – Updated model object

Examples

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