eelbrain.Var
- class eelbrain.Var(x, name=None, info=None, repeat=1, tile=1)
Container for scalar data.
- Parameters:
x (ArrayLike) – Data; is converted with
np.asarray(x)
. Multidimensional arrays are flattened as long as only 1 dimension is longer than 1.name (str) – Name of the variable
info (dict) – Info dictionary. The “longname” entry is used for display purposes.
repeat (Union[ArrayLike, int]) – repeat each element in
x
, either a constant or a different number for each element.tile (int) – Repeat
x
as a wholetile
many times.
- Variables:
x (numpy.ndarray) – The data stored in the Var.
name (None | str) – The Var’s name.
Notes
While
Var
objects support a few basic operations in anumpy
-like fashion (+
,-
,*
,/
,//
), theirVar.x
attribute provides access to the correspondingnumpy.array
which can be used for anything more complicated.Var.x
can be read and modified, but should not be replaced.
Methods
|
Return a Var with the absolute value. |
|
Summarize cases within cells of |
|
Index of the largest value |
|
Index of the smallest value |
|
|
|
Convert the Var into a Factor |
|
Copy of the Var with data cast to the specified type |
|
Return a deep copy |
|
Count the number of occurrence of each value |
|
The differences between consecutive values |
|
Construct a Var instance by applying a function to each value in a base |
|
Construct a Var object by mapping |
|
|
|
Boolean index, True where the Var is equal to one of the values |
|
Boolean index, True where the Var value is in values |
|
Return boolean |
|
Boolean index, True where the Var is not equal to one of the values |
|
Boolean index, True where the Var value is not in values |
|
Element-wise log |
|
The largest value |
|
The mean |
|
The smallest value |
|
Repeat each element |
|
Create an index that could be used to sort the Var. |
|
A Factor splitting y into |
|
The standard deviation |
|
The sum over all values |
|
Construct a Var by repeating |
|
The variance |