PyFoam.Wrappers.Pandas module

Extended version of the Pandas-Dataframe

exception PyFoam.Wrappers.Pandas.PandasWrapperPyFoamException(*text)[source]

Bases: PyFoam.Error.PyFoamException

The PyFoam-exception that does not expect to be caught

__init__(*text)[source]

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'PyFoam.Wrappers.Pandas'
class PyFoam.Wrappers.Pandas.PyFoamDataFrame(*args, **kwargs)[source]

Bases: pandas.core.frame.DataFrame

This class adds some convenience functions to the regular Datafram class

_PyFoamDataFrame__allStrings(keys=None)
_PyFoamDataFrame__integrateInternal(columns)
__getitem__(key)[source]

If this gets a number as the key it tries to get the row that is nearest to this number. If it is something list-like and the elements of the lists are numbers then all the elements of the list are looked up, sorted and mad unique. Afterwards it gets the rows that are nearest to the numbers. Otherwise it defaults to the []-operator of the DataFram-class but converts the result to a PyFoamDataFrame

__init__(*args, **kwargs)[source]

Adds no data. Just passes the arguments to the super-class

__module__ = 'PyFoam.Wrappers.Pandas'
addData(other, sameIndex=True, mergeIndex=False, prefix=None, suffix=None, allowExtrapolate=False, interpolationMethod='values')[source]

Add data from another DataFrame or Series :param other: data as Pandas-DataFrame or Series :param sameIndex: assum both have the same indices. If False the other data will be interpolated to the current indices :param mergeIndex: make the result indices a mixture of the indices

describe(*args, **kwargs)[source]

Adds our own statistics to the regular describe

integrate(columns=None)[source]

Integrate by using the trapezoid rule. Return a dictionary with values. :param values: list of column names. If unset all are integrated

validLength(columns=None)[source]

Length were the values are valid (not NaN) Return a dictionary with values. :param values: list of column names. If unset all are integrated

validOtherTypes = (<class 'pandas.core.frame.DataFrame'>, <class 'pandas.core.series.Series'>)
weightedAverage(columns=None)[source]

Weighted average. Return a dictionary with values. :param values: list of column names. If unset all are integrated