Results#

class pharmpy.workflows.Results(__version__='1.3.0')[source]#

Bases: Immutable

Base class for all result classes

Methods Summary

from_dict(d)

Create results object from dictionary

get_and_reset_index(attr, **kwargs)

Wrapper to reset index of attribute or result from method.

to_csv(path)

Save results as a human readable csv file

to_dict()

Convert results object to a dictionary

to_json([path, lzma])

Serialize results object as json

Methods Documentation

classmethod from_dict(d)[source]#

Create results object from dictionary

get_and_reset_index(attr, **kwargs)[source]#

Wrapper to reset index of attribute or result from method.

Used to facilitate importing multiindex dataframes into R

to_csv(path)[source]#

Save results as a human readable csv file

Index will not be printed if it is a basic range.

Parameters:

path (Path) – Path to csv-file

to_dict()[source]#

Convert results object to a dictionary

to_json(path=None, lzma=False)[source]#

Serialize results object as json

Parameters:
  • path (Path) – Path to save json file or None to serialize to string

  • lzma (bool) – Set to compress file with lzma

Returns:

str – Json as string unless path was used