exa.core.numerical module¶
Data Objects¶
Data objects are used to store typed data coming from an external source (for
example a file on disk). There are three primary data objects provided by
this module, Series
, DataFrame
,
and Field
. The purpose of these objects is to facilitate
conversion of data into “traits” used in visualization and enforce relationships
between data objects in a given container. Any of the objects provided by this
module may be extended.
-
class
exa.core.numerical.
Numerical
[source]¶ Bases:
object
Base class for
Series
,DataFrame
, andField
objects, providing default trait functionality and clean representations when present as part of containers.-
property
log
¶
-
property
-
class
exa.core.numerical.
BaseSeries
(*args, **kwargs)[source]¶ Bases:
exa.core.numerical.Numerical
Base class for dense and sparse series objects (labeled arrays).
-
_iname (str
May have a required index name
-
-
class
exa.core.numerical.
BaseDataFrame
(*args, **kwargs)[source]¶ Bases:
exa.core.numerical.Numerical
Base class for dense and sparse dataframe objects (labeled matrices).
Note
If the _cardinal attribute is populated, it will automatically be added to the _categories and _columns attributes.
-
_cardinal
¶ Tuple of column name and raw type that acts as foreign key to index of another table
- Type
-
_categories
¶ Dict of column names, raw types that if present will be converted to and from categoricals automatically
- Type
-
-
class
exa.core.numerical.
Series
(*args, **kwargs)[source]¶ Bases:
exa.core.numerical.BaseSeries
,pandas.core.series.Series
A labeled array.
class MySeries(exa.core.numerical.Series): _sname = 'data' # series default name _iname = 'data_index' # series default index name seri = MySeries(np.random.rand(10**5))
-
copy
(*args, **kwargs)[source]¶ Make a copy of this object.
See also
For arguments and description of behavior see pandas docs.
-
-
class
exa.core.numerical.
DataFrame
(*args, **kwargs)[source]¶ Bases:
exa.core.numerical.BaseDataFrame
,pandas.core.frame.DataFrame
A data table
class MyDF(exa.core.numerical.DataFrame): _cardinal = ('cardinal', int) _index = 'mydf_index' _columns = ['x', 'y', 'z', 'symbol'] _categories = {'symbol': str}
-
copy
(*args, **kwargs)[source]¶ Make a copy of this object.
See also
For arguments and description of behavior see pandas docs.
-
-
class
exa.core.numerical.
Field
(*args, **kwargs)[source]¶ Bases:
exa.core.numerical.DataFrame
A field is defined by field data and field values. Field data defines the discretization of the field (i.e. its origin in a given space, number of steps/step spaceing, and endpoint for example). Field values can be scalar (series) and/or vector (dataframe) data defining the magnitude and/or direction at each given point.
Note
The convention for generating the discrete field data and ordering of the field values must be the same (e.g. discrete field points are generated x, y, then z and scalar field values are a series object ordered looping first over x then y, then z).
In addition to the
DataFrame
attributes, this object has the following:-
copy
(*args, **kwargs)[source]¶ Make a copy of this object.
Note
Copies both field data and field values.
See also
For arguments and description of behavior see pandas docs.
-
-
class
exa.core.numerical.
Field3D
(*args, **kwargs)[source]¶ Bases:
exa.core.numerical.Field
Dataframe for storing dimensions of a scalar or vector field of 3D space.
Column
Type
Description
nx
int
number of grid points in x
ny
int
number of grid points in y
nz
int
number of grid points in z
ox
float
field origin point in x
oy
float
field origin point in y
oz
float
field origin point in z
xi
float
First component in x
xj
float
Second component in x
xk
float
Third component in x
yi
float
First component in y
yj
float
Second component in y
yk
float
Third component in y
zi
float
First component in z
zj
float
Second component in z
zk
float
Third component in z
Note
Each field should be flattened into an N x 1 (scalar) or N x 3 (vector) series or dataframe respectively. The orientation of the flattening should have x as the outer loop and z values as the inner loop (for both cases). This is sometimes called C-major or C-style order, and has the last index changing the fastest and the first index changing the slowest.
See also
-
exa.core.numerical.
check_key
(data_object, key, cardinal=False)[source]¶ Update the value of an index key by matching values or getting positionals.