pytemppack.py_pack.PyPack

class PyPack(data)[source]

Bases: object

PyPack object for transforming np.ndarray to pd.DataFrame.

This class contains methods to transform an np.ndarray to pd.DataFrame.

results

A dataframe with the canonical inputs.

Type

pd.DataFrame

Examples

>>> pypack = PyPack(data)
>>> pypack.transform(columns)

Initialize with np.ndarray data.

Parameters

data (np.ndarray) – The data that has to be transformed into a pd.DataFrame.

Raises

ValueError – If the data is not an np.ndarray.

Methods

transform_results

Transform the data into a pd.DataFrame.

Attributes

results

transform_results(columns=None)[source]

Transform the data into a pd.DataFrame.

The np.ndarray will be transposed as the rows are considered to be columns, and vice versa.

Parameters

columns (Optional[List[str]]) – The column names that can be used in the pd.DataFrame.

Return type

None

Note

The transformed data is not returned but attributed to results.