get_dv_symbol#

pharmpy.modeling.get_dv_symbol(model, dv=None)[source]#

Get the symbol for a certain dvid or dv and check that it is valid

Parameters:
  • model (Model) – Pharmpy model

  • dv (Union[sympy.Symbol, str, int]) – Either a dv symbol, str or dvid. If None (default) return the only or first dv.

Returns:

sympy.Symbol – DV symbol

Example

>>> from pharmpy.modeling import load_example_model, get_dv_symbol
>>> model = load_example_model("pheno")
>>> get_dv_symbol(model, "Y")
Y
>>> get_dv_symbol(model, 1)
Y