Multi-Block Structures#

Vector#

Constructor#

Vector(data[, name, index, dtype, copy])

State or observation vector composed of one or more Block objects.

Attributes and underlying data#

Vector.name

The name of the underlying Series.

Vector.data

The underlying data, which must be numeric and non-NaN.

Vector.index

Return the index of the underlying data.

Vector.shape

Return the shape of the underlying data.

Vector.values

Return the values as a numpy array.

Vector.blocks

Accessor for retrieving Block instances from the Vector.

Conversion#

Vector.copy([deep])

Create a copy of the structure.

Vector.to_series()

Get the underlying Series data.

Vector.to_numpy()

Get the underlying data as a NumPy array.

Vector.to_xarray()

Convert the Vector to xarray.

Reindexing / selection / label manipulation#

Vector.__getitem__(block)

Get block by name.

Vector.xs(key[, axis, level, drop_level])

Cross-select data based on index/column values.

Vector.reindex(index[, columns, ...])

Return a new instance with data reindexed to the specified index and columns.

Vector.round_index(decimals[, axis, inplace])

Round float indices on the specified axis to given decimals.

Serialization#

Vector.from_file(path)

Load object from a pickle file.

Vector.to_file(path)

Save object to a pickle file.

Matrix#

Constructor#

Matrix(data[, name, index, columns, dtype, ...])

Base class for all matrix-like objects in the inversion framework.

Attributes and underlying data#

Matrix.name

Name of the structure, used for error messages and block naming.

Matrix.data

The underlying data, which must be numeric and non-NaN.

Matrix.index

Return the index of the underlying data.

Matrix.columns

Return the columns of the underlying DataFrame.

Matrix.shape

Return the shape of the underlying data.

Matrix.values

Return values as numpy array or sparse matrix.

Conversion#

Matrix.copy([deep])

Create a copy of the structure.

Matrix.to_frame()

Get the underlying DataFrame data.

Matrix.to_numpy()

Get the underlying data as a NumPy array.

Reindexing / selection / label manipulation#

Matrix.__getitem__(block)

Get the submatrix DataFrame for the given (row_block, col_block) tuple.

Matrix.xs(key[, axis, level, drop_level])

Cross-select data based on index/column values.

Matrix.reindex(index[, columns, ...])

Return a new instance with data reindexed to the specified index and columns.

Matrix.round_index(decimals[, axis, inplace])

Round float indices on the specified axis to given decimals.

Computations#

Matrix.scale(factor)

Scale the matrix by a scalar factor.

Binary operations#

Matrix.__add__(other)

Add two Matrix instances.

Serialization#

Matrix.from_file(path)

Load object from a pickle file.

Matrix.to_file(path)

Save object to a pickle file.

Sparse support#

Matrix.is_sparse

True if the internal DataFrame uses pandas sparse storage.

Matrix.to_sparse([threshold])

Return a copy with sparse internal storage.

Matrix.to_dense()

Return a copy with dense internal storage.