plspm.util module

class plspm.util.TopoSort

Bases: object

Internal fucntion which performs a topological sort using Kahn’s algorithm

__init__()

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

append(src: str, dest: str)
elements()
order()
plspm.util.dummy(data: pandas.core.series.Series) → pandas.core.frame.DataFrame

Internal function used to create a dummy matrix used to perform calculations with ordinal and nominal data

plspm.util.groupby_mean(data: numpy.ndarray) → numpy.ndarray

Internal function which performs the Numpy equivalent of Pandas .groupby(...).mean()

plspm.util.impute(data: pandas.core.frame.DataFrame) → pandas.core.frame.DataFrame

Internal function that imputes missing data using the mean value (only suitable for metric data).

plspm.util.list_to_dummy(data: dict) → pandas.core.frame.DataFrame

Internal function used to create the outer design matrix.

plspm.util.rank(data: pandas.core.series.Series) → pandas.core.series.Series

Internal function used to rank ordinal and nominal data.

plspm.util.sort_cols(data: pandas.core.frame.DataFrame) → pandas.core.frame.DataFrame

Internal convenience function to sort data by column.

plspm.util.treat(data: pandas.core.frame.DataFrame, center: bool = True, scale: bool = True, scale_values=None) → pandas.core.frame.DataFrame

Internal function that treats data in Pandas Dataframe format.

Parameters:
  • data – The data to treat
  • center – Whether to center the data
  • scale – Whether to scale the data
  • scale_values – The scaling to use
Returns:

The treated data

plspm.util.treat_numpy(data: numpy.ndarray) → numpy.ndarray

Internal function that centers and scales data in Numpy format.

Parameters:data – The data to treat
Returns:The treated data