How to use the petab.core.get_notnull_columns function in petab

To help you get started, we’ve selected a few petab examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ICB-DCM / pyPESTO / pypesto / petab_import / petab_import.py View on Github external
that for each group an amici.ExpData can be generated.

    Returns
    -------
    (grouping_cols, simulation_conditions): tuple
        Here, grouping_cols is the columns according to which the grouping
        was done, and simulation_conditions are the identified conditions.
    """
    # make sure index is reset
    condition_df = condition_df.reset_index()

    # find columns to group by (i.e. if not all nans).
    # number of amici simulations will be number of unique
    # (preequilibrationCondition, simulationCondition) pairs.
    # can be improved by checking for identical condition vectors.
    grouping_cols = petab.core.get_notnull_columns(
        measurement_df,
        ['simulationConditionId', 'preequilibrationConditionId'])

    # group by cols and return dataframe containing each combination
    # of those rows only once (and an additional counting row)
    simulation_conditions = measurement_df.groupby(
        grouping_cols).size().reset_index()

    return grouping_cols, simulation_conditions