get_doseid#

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

Get a DOSEID series from the dataset with an id of each dose period starting from 1

If a a dose and observation exist at the same time point the observation will be counted towards the previous dose.

Parameters:

model (Model) – Pharmpy model

Returns:

pd.Series – DOSEIDs

Examples

>>> from pharmpy.modeling import load_example_model, get_doseid
>>> model = load_example_model("pheno")
>>> get_doseid(model)  
0       1
1       1
2       2
3       3
4       4
       ..
739    10
740    11
741    12
742    13
743    13
Name: DOSEID, Length: 744, dtype: int...