amici.pandas

Pandas Wrappers

This module contains convenience wrappers that allow for easy interconversion between C++ objects from amici.amici and pandas DataFrames

Functions Summary

constructEdataFromDataFrame(df, model, condition)

Constructs an ExpData instance according to the provided Model and DataFrame.

getDataObservablesAsDataFrame(model, edata_list)

Write Observables from experimental data as DataFrame.

getEdataFromDataFrame(model, df[, by_id])

Constructs a ExpData instances according to the provided Model and DataFrame.

getResidualsAsDataFrame(model, edata_list, ...)

Convert a list of ReturnData and ExpData to pandas DataFrame with residuals.

getSimulationObservablesAsDataFrame(model, ...)

Write Observables from simulation results as DataFrame.

getSimulationStatesAsDataFrame(model, ...[, ...])

Get model state according to lists of ReturnData and ExpData.

get_expressions_as_dataframe(model, ...[, by_id])

Get values of model expressions from lists of ReturnData as DataFrame.

Functions

amici.pandas.constructEdataFromDataFrame(df, model, condition, by_id=False)[source]

Constructs an ExpData instance according to the provided Model and DataFrame.

Parameters
  • df (pandas.core.frame.DataFrame) – pd.DataFrame with Observable Names/Ids as columns. Standard deviations may be specified by appending ‘_std’ as suffix.

  • model (typing.Union[amici.amici.ModelPtr, amici.amici.Model]) – Model instance.

  • condition (pandas.core.series.Series) – pd.Series with FixedParameter Names/Ids as columns. Preequilibration conditions may be specified by appending ‘_preeq’ as suffix. Presimulation conditions may be specified by appending ‘_presim’ as suffix.

  • by_id (typing.Optional[bool]) – Indicate whether in the arguments, column headers are based on ids or names. This should correspond to the way df and condition was created in the first place.

Return type

amici.amici.ExpData

Returns

ExpData instance.

amici.pandas.getDataObservablesAsDataFrame(model, edata_list, by_id=False)[source]

Write Observables from experimental data as DataFrame.

Parameters
Return type

pandas.core.frame.DataFrame

Returns

pandas DataFrame with conditions/timepoints as rows and observables as columns.

amici.pandas.getEdataFromDataFrame(model, df, by_id=False)[source]

Constructs a ExpData instances according to the provided Model and DataFrame.

Parameters
  • df (pandas.core.frame.DataFrame) – dataframe with Observable Names/Ids, FixedParameter Names/Ids and time as columns. Standard deviations may be specified by appending ‘_std’ as suffix. Preequilibration fixedParameters may be specified by appending ‘_preeq’ as suffix. Presimulation fixedParameters may be specified by appending ‘_presim’ as suffix. Presimulation time may be specified as ‘t_presim’ column.

  • model (typing.Union[amici.amici.ModelPtr, amici.amici.Model]) – Model instance.

  • by_id (typing.Optional[bool]) – Whether the column names in df are based on ids or names, corresponding to how the dataframe was created in the first place.

Return type

typing.List[amici.amici.ExpData]

Returns

list of ExpData instances.

amici.pandas.getResidualsAsDataFrame(model, edata_list, rdata_list, by_id=False)[source]

Convert a list of ReturnData and ExpData to pandas DataFrame with residuals.

Parameters
Return type

pandas.core.frame.DataFrame

Returns

pandas DataFrame with conditions and residuals.

amici.pandas.getSimulationObservablesAsDataFrame(model, edata_list, rdata_list, by_id=False)[source]

Write Observables from simulation results as DataFrame.

Parameters
Return type

pandas.core.frame.DataFrame

Returns

pandas DataFrame with conditions/timepoints as rows and observables as columns.

amici.pandas.getSimulationStatesAsDataFrame(model, edata_list, rdata_list, by_id=False)[source]

Get model state according to lists of ReturnData and ExpData.

Parameters
Return type

pandas.core.frame.DataFrame

Returns

pandas DataFrame with conditions/timepoints as rows and state variables as columns.

amici.pandas.get_expressions_as_dataframe(model, edata_list, rdata_list, by_id=False)[source]

Get values of model expressions from lists of ReturnData as DataFrame.

Parameters
Return type

pandas.core.frame.DataFrame

Returns

pandas DataFrame with conditions/timepoints as rows and model expressions as columns.