drop_columns#

pharmpy.modeling.drop_columns(model, column_names, mark=False)[source]#

Drop columns from the dataset or mark as dropped

Parameters:
  • model (Model) – Pharmpy model object

  • column_names (list or str) – List of column names or one column name to drop or mark as dropped

  • mark (bool) – Default is to remove column from dataset. Set this to True to only mark as dropped

Returns:

Model – Pharmpy model object

Example

>>> from pharmpy.modeling import *
>>> model = load_example_model("pheno")
>>> model = drop_columns(model, ['WGT', 'APGR'])
>>> list(model.dataset.columns)
['ID', 'TIME', 'AMT', 'DV', 'FA1', 'FA2']

See also

drop_dropped_columns

Drop all columns marked as drop

undrop_columns

Undrop columns of model