Skip to content

index

BaseIndex

Bases: ImmutableObject, ABC

Base class for SaolaPy indices.

query_columns abstractmethod property

query_columns

Returns PQL column of index.

query_column_names property

query_column_names

Returns list of query column names.

query_column_queries property

query_column_queries

Returns list of query column queries.

object_str staticmethod

object_str(class_name, properties)

Returns string representation of object with given class name and properties.

Parameters:

  • class_name (str) –

    Name of object class.

  • properties (OrderedDict[str, Any]) –

    Properties to include.

Returns:

  • str

    String representation.

shorten_string staticmethod

shorten_string(string, max_length=None)

Shortens string to have maximum of max_length characters.

Index

Index(data, name='Index')

Bases: BaseIndex

One-dimensional PQL Index.

Parameters:

  • data (ColumnLike) –

    Data to be used. Can be either PQL query string, PQLColumn, or PQLOperator.

  • name (str, default: 'Index' ) –

    Name of object. Defaults to 'Index'.

query_column_names property

query_column_names

Returns list of query column names.

query_column_queries property

query_column_queries

Returns list of query column queries.

data property

data

Returns data of index.

name property

name

Returns name of index.

query_columns property

query_columns

Returns PQL columns of index.

object_str staticmethod

object_str(class_name, properties)

Returns string representation of object with given class name and properties.

Parameters:

  • class_name (str) –

    Name of object class.

  • properties (OrderedDict[str, Any]) –

    Properties to include.

Returns:

  • str

    String representation.

shorten_string staticmethod

shorten_string(string, max_length=None)

Shortens string to have maximum of max_length characters.

MultiIndex

MultiIndex(levels)

Bases: BaseIndex

Multi-dimensional PQL Index.

Parameters:

  • levels (List[Index]) –

    Indices to be used as multi index.

query_column_names property

query_column_names

Returns list of query column names.

query_column_queries property

query_column_queries

Returns list of query column queries.

levels property

levels

Returns levels of multi index.

names property

names

Names of levels in multi index.

nlevels property

nlevels

Returns number of levels of multi index.

query_columns property

query_columns

Returns PQL columns of multi index.

object_str staticmethod

object_str(class_name, properties)

Returns string representation of object with given class name and properties.

Parameters:

  • class_name (str) –

    Name of object class.

  • properties (OrderedDict[str, Any]) –

    Properties to include.

Returns:

  • str

    String representation.

shorten_string staticmethod

shorten_string(string, max_length=None)

Shortens string to have maximum of max_length characters.

RangeIndex

RangeIndex(start=0, step=1, name='Index')

Bases: Index

Immutable index implementing a monotonically increasing integer range.

Parameters:

  • start (int, default: 0 ) –

    Start of range, defaults to 0.

  • step (int, default: 1 ) –

    Step size of range, defaults to 1.

  • name (str, default: 'Index' ) –

    Name of object.

query_columns property

query_columns

Returns PQL columns of index.

query_column_names property

query_column_names

Returns list of query column names.

query_column_queries property

query_column_queries

Returns list of query column queries.

data property

data

Returns data of index.

name property

name

Returns name of index.

object_str staticmethod

object_str(class_name, properties)

Returns string representation of object with given class name and properties.

Parameters:

  • class_name (str) –

    Name of object class.

  • properties (OrderedDict[str, Any]) –

    Properties to include.

Returns:

  • str

    String representation.

shorten_string staticmethod

shorten_string(string, max_length=None)

Shortens string to have maximum of max_length characters.