get_number_of_observations#

pharmpy.modeling.get_number_of_observations(model)[source]#

Retrieve the total number of observations in the model dataset

Parameters:

model (Model) – Pharmpy model

Returns:

int – Number of observations in the model dataset

Examples

>>> from pharmpy.modeling import get_number_of_observations, load_example_model
>>> model = load_example_model("pheno")
>>> get_number_of_observations(model)
155

Notes

For NONMEM models this is the number of observations of the active dataset, i.e. after filtering of IGNORE and ACCEPT and removal of individuals with no observations.

See also

get_number_of_individuals

Get the number of individuals in a dataset

get_number_of_observations_per_individual

Get the number of observations per individual in a dataset