eqtk.to_df

eqtk.to_df(c, c0=None, names=None, units=None)

Convert output to a Pandas DataFrame.

It is preferred to use the names keyword argument when calling eqtk.solve() that this function.

Parameters
  • c (Numpy array) – Equilibrium concentrations of all species. c[i, j] is the equilibrium concentration of species j for initial concentrations given by c0[i, :] in units given by units.

  • c0 (Numpy array, Pandas Series, or Pandas DataFrame; or None) – The value of c0 that was used in a call to eqtk.solve(), eqtk.solveNK(), eqtk.solveNG(), or eqtk.solveAG(). If None, then no information about initial concentrations will be added to the outputted data frame.

  • names (list of strings) – Names of the chemical species. If None, the names are assumed to be ‘species_1’, ‘species_2’, etc.

  • units (str) – The units of concentration. The column headings in the outputted data frame have f’ ({units})’ appended to them.

Returns

output – If a single calculation was done, the output is a Pandas Series, otherwise a Pandas DataFrame. The column headings are descriptive, e.g., for chemical species HA, with units = ‘mM’, the heading is ‘[HA] (mM)’.

Return type

Pandas DataFrame or Pandas Series

Raises

ValueError – If the inputted c is not a Numpy array.