BaseTabular Class#

This is the base class for tabular data structures in PyNeon, such as pyneon.Events and pyneon.Stream. It is not intended to be used directly, but provides common functionality for its subclasses.

class pyneon.tabular.BaseTabular(data: DataFrame)#

Bases: object

Base for tabular data classes like pyneon.Events and pyneon.Stream.

When initialized, performs the following checks and processing on the input data:

  1. Ensures the data is not empty.

  2. If present, checks that recording id and section id columns contain only a single unique value, and removes these columns.

  3. Identifies and handles duplicate columns by retaining only the first occurrence and issuing a warning.

  4. Sets the data types of columns based on a predefined mapping. Columns not found in this mapping are left with their default data types, and a warning is issued.

Parameters:
datapandas.DataFrame

Raw data to be processed.

Attributes:
datapandas.DataFrame

The processed data.

Methods

copy()

Create a deep copy of the instance.

property shape: tuple[int, int]#

Return a tuple representing the shape of the data.

Returns:
tuple[int, int]

Shape of the data as (rows, columns).

property columns: Index#

Return the column labels of the data.

Returns:
pd.Index

Column labels of the data.

property dtypes: Series#

Return the data types of the columns in the data.

Returns:
pd.Series

Data types of the columns in the data.

copy()#

Create a deep copy of the instance.