Integer modulus of division
Integer modulus of division
type of the other operand
result type of operation
other operand instance (divisor)
implicit evidence for operation between this and other
Bit-wise AND
Bit-wise AND
type of the other operand
result type of operation
other operand instance
implicit evidence for operation between this and other
Logical AND
Logical AND
type of the other operand
result type of operation
other operand instance
implicit evidence for operation between this and other
Multiplication
Multiplication
type of the other operand
result type of operation
other operand instance
implicit evidence for operation between this and other
Exponentiation
Exponentiation
type of the other operand
result type of operation
other operand instance (exponent)
implicit evidence for operation between this and other
Addition
Addition
type of the other operand
result type of operation
other operand instance
implicit evidence for operation between this and other
Subtraction
Subtraction
type of the other operand
result type of operation
other operand instance
implicit evidence for operation between this and other
Division
Division
type of the other operand
result type of operation
other operand instance (divisor)
implicit evidence for operation between this and other
Less-than comparison operator
Less-than comparison operator
type of the other operand
result type of operation
other operand instance
implicit evidence for operation between this and other
Bit-shift left
Bit-shift left
type of the other operand
result type of operation
other operand instance
implicit evidence for operation between this and other
Less-than-or-equal-to comparison operator
Less-than-or-equal-to comparison operator
type of the other operand
result type of operation
other operand instance
implicit evidence for operation between this and other
Element-wise inequality operator
Element-wise inequality operator
type of the other operand
result type of operation
other operand instance
implicit evidence for operation between this and other
Element-wise equality operator
Element-wise equality operator
type of the other operand
result type of operation
other operand instance
implicit evidence for operation between this and other
Greater-than comparison operator
Greater-than comparison operator
type of the other operand
result type of operation
other operand instance
implicit evidence for operation between this and other
Greater-than-or-equal-to comparison operator
Greater-than-or-equal-to comparison operator
type of the other operand
result type of operation
other operand instance
implicit evidence for operation between this and other
Bit-shift right (arithmetic)
Bit-shift right (arithmetic)
type of the other operand
result type of operation
other operand instance
implicit evidence for operation between this and other
Bit-shift right (logical)
Bit-shift right (logical)
type of the other operand
result type of operation
other operand instance
implicit evidence for operation between this and other
The transpose of the frame (swapping the axes)
Bit-wise EXCLUSIVE OR
Bit-wise EXCLUSIVE OR
type of the other operand
result type of operation
other operand instance
implicit evidence for operation between this and other
Aligns this frame with another frame, returning the left and right frames aligned to each others indexes according to the the provided parameters
Aligns this frame with another frame, returning the left and right frames aligned to each others indexes according to the the provided parameters
Other frame to align with
How to perform the join on the row indexes
How to perform the join on the col indexes
Slice from by an array of row keys and an array of col keys
Slice from by an array of row keys and an array of col keys
An array of row keys
An array of col keys
Slice frame by array of row keys and a col slice
Slice frame by array of row keys and a col slice
An array of row keys
A col slice
Slice frame by row slice and array of column keys
Slice frame by row slice and array of column keys
A row slice
An array of column keys
Slice frame by row and column slice specifiers
Slice frame by row and column slice specifiers
A row slice
A col slice
Access a slice of the Frame by Slice parameters
Access a slice of the Frame by Slice parameters
Slice to apply to rows
Slice to apply to cols
Access a slice of the Frame by integer offsets
Access a slice of the Frame by integer offsets
Integer row offset
Array of col offsets
Access a slice of the Frame by integer offsets
Access a slice of the Frame by integer offsets
Array of row offsets
Integer col offset
Access a slice of the Frame by integer offsets
Access a slice of the Frame by integer offsets
Array of row offsets
Array of col offsets
Access a (Scalar-boxed) value from within the Frame
Access a (Scalar-boxed) value from within the Frame
Integer row offset
Integer col offset
Given an array of column keys, slice out the corresponding column(s)
Given an array of column keys, slice out the corresponding column(s)
Array of keys
Given a Slice of type of column key, slice out corresponding column(s)
Given a Slice of type of column key, slice out corresponding column(s)
Slice containing appropriate key bounds
Given one or more column keys, slice out the corresponding column(s)
Given one or more column keys, slice out the corresponding column(s)
Column key(s) (sequence)
Access frame columns specified by a slice
Access frame columns specified by a slice
a slice specifier
Access frame columns at a particular integer offsets
Access frame columns at a particular integer offsets
an array of integer offsets
Access frame columns at a particular integer offsets
Access frame columns at a particular integer offsets
a sequence of integer offsets
Access frame column at a particular integer offset
Access frame column at a particular integer offset
integer offset
An index for the columns
Access frame columns between two integer offsets, [from, until)
Access frame columns between two integer offsets, [from, until)
Beginning offset
One past ending offset
Optional increment between offsets
Slice out a set of columns from the frame
Slice out a set of columns from the frame
Key from which to begin slicing
Key at which to end slicing
Whether to include 'to' key; true by default
Split Frame into two frames at column position c
Split Frame into two frames at column position c
Position at which to split Frame
Split Frame into two frames at column key k
Split Frame into two frames at column key k
Key at which to split Frame
Extract columns from a heterogeneous Frame which match either of the provided types.
Extract columns from a heterogeneous Frame which match either of the provided types. The result is a heterogeneous frame consisting of the selected data.
First type of columns to extract
Second type of columns to extract
Extract columns from a heterogeneous Frame which match the provided type.
Extract columns from a heterogeneous Frame which match the provided type. The result is a homogeneous frame consisting of the selected data.
The type of columns to extract
Concatenate two Frame instances together (vertically) whose indexes share the same type of elements, and where there exists some way to join the values of the Frames.
Concatenate two Frame instances together (vertically) whose indexes share the same type
of elements, and where there exists some way to join the values of the Frames. For
instance, Frame[X, Y, Double] concat
Frame[X, Y, Int] will promote Int to Double as
a result of the implicit existence of a Promoter[Double, Int, Double] instance.
The resulting row index will simply be the concatenation of the input row indexes, and
the column index will be the joint index (with join type specified as argument).
type of other Frame values
type of resulting Frame values
Frame[RX, CX, U] to concat
Implicit evidence of Promoter
See shift; operates col-wise
Dot (inner) product
Dot (inner) product
type of the other operand
result type of operation
other operand instance
implicit evidence for operation between this and other
Return Frame excluding any of those columns which have an NA value
Return empty series of type equivalent to a column of frame
Return empty series of type equivalent to a row of frame
Return Frame whose columns satisfy a predicate function operating on that column
Return Frame whose columns satisfy a predicate function operating on that column
Predicate function from Series[RX, T] => Boolean
Return Frame whose columns satisfy a predicate function operating on the column index offset
Return Frame whose columns satisfy a predicate function operating on the column index offset
Predicate function from CX => Boolean
Return Frame whose columns satisfy a predicate function operating on the column index
Return Frame whose columns satisfy a predicate function operating on the column index
Predicate function from CX => Boolean
Extract first row matching a particular key
Extract first row matching a particular key
Key to match
Extract first col matching a particular key
Extract first col matching a particular key
Key to match
Map over each triple (r, c, v) in the Frame, flattening results, and returning a new frame from the resulting triples.
Construct a FrameGrouper with which further computations, such as combine or transform, may be performed.
Construct a FrameGrouper with which further computations, such as combine or transform, may be performed. The groups are constructed from the keys of the provided index, with each unique key corresponding to a group.
Type of elements of ix
Index with which to perform grouping
Construct a FrameGrouper with which further computations, such as combine or transform, may be performed.
Construct a FrameGrouper with which further computations, such as combine or transform, may be performed. The groups are constructed from the result of the function applied to the keys of the row index; each unique result of calling the function on elements of the row index corresponds to a group.
Type of function codomain
Function from RX => Y
Construct a FrameGrouper with which further computations, such as combine or transform, may be performed.
Construct a FrameGrouper with which further computations, such as combine or transform, may be performed. The groups are constructed from the keys of the row index, with each unique key corresponding to a group.
Extract first n rows
Extract first n rows
number of rows to extract
Extract first n columns
Extract first n columns
number of columns to extract
Returns true if there are no values in the Frame
Perform a join with another Frame[RX, CX, T] according to the row index.
Perform a join with another Frame[RX, CX, T] according to the row index. The how
argument dictates how the join is to be performed:
The result is a Frame whose row index is the result of the join, and whose column index has been reset to [0, M + N), where M is the number of columns in the left frame and N in the right, and whose values are sourced from the original Frames.
Frame to join with
How to perform the join
Same as join, but the values of Frame to join with may be of type Any, so that the resulting Frame may be heterogeneous in its column types.
Same as joinAny
, but preserves column index
Same as joinS, but the values of Series to join with may be of type Any, so that the resulting Frame may be heterogeneous in its column types.
Same as joinAnyS
, but preserve the column index, adding the specified index value,
newColIx
as an index for the other
Series.
Joins two frames along both their indexes and applies a function to each pair of values; when either value is NA, the result of the function is forced to be NA.
Joins two frames along both their indexes and applies a function to each pair of values; when either value is NA, the result of the function is forced to be NA.
The type of other frame values
The result type of the function
Other Frame
The type of join to effect on the rows
The type of join to effect on the cols
The function to apply
Same as join
, but preserves column index
Perform a join with another Series[RX, T] according to the row index.
Perform a join with another Series[RX, T] according to the row index. The how
argument dictates how the join is to be performed:
The result is a Frame whose row index is the result of the join, and whose column index has been reset to [0, numcols], and whose values are sourced from the original Frame and Series.
Series to join with
How to perform the join
Same as joinS
, but preserve the column index, adding the specified index value,
newColIx
as an index for the other
Series.
Extract last row matching a particular key
Extract last row matching a particular key
Key to match
Extract first col matching a particular key
Extract first col matching a particular key
Key to match
Map over each triple (r, c, v) in the Frame, returning a new frame from the resulting triples.
Map a function over the col index, resulting in a new Frame
Map a function over the col index, resulting in a new Frame
Result type of index, ie Index[Y]
The function CX => Y with which to map
Map a function over the row index, resulting in a new Frame
Map a function over the row index, resulting in a new Frame
Result type of index, ie Index[Y]
The function RX => Y with which to map
Map over the values of the Frame.
Map over the values of the Frame. Applies a function to each (non-na) value in the frame, returning a new frame whose indices remain the same.
The type of the resulting values
Function from T to U
Map a function over each column vector and collect the results into a Frame respecting the original indexes.
Map a function over each column vector and collect the results into a Frame respecting the original indexes.
Type of result Vec of the function
Function acting on Vec[T] and producing another Vec
Create a new Frame whose columns follow the rule that, wherever the mask Vec is true, the column value is masked with NA
Create a new Frame whose columns follow the rule that, wherever the mask Vec is true, the column value is masked with NA
Mask Vec[Boolean]
Create a new Frame that, whenever the mask predicate function evaluates to true on a value, is masked with NA
Create a new Frame that, whenever the mask predicate function evaluates to true on a value, is masked with NA
Function from T to Boolean
Melt stacks the row index of arity N with the column index of arity M to form a result index of arity N + M, producing a 1D Series whose values are from the original Frame as indexed by the corresponding keys.
Melt stacks the row index of arity N with the column index of arity M to form a result index of arity N + M, producing a 1D Series whose values are from the original Frame as indexed by the corresponding keys.
For example, given:
Frame(1 -> Series('a' -> 1, 'b' -> 3), 2 -> Series('a' -> 2, 'b' -> 4)).melt
produces:
res0: org.saddle.Series[(Char, Int),Int] = [4 x 1] a 1 => 1 2 => 2 b 1 => 3 2 => 4
Output type (tuple of arity N + M)
Implicit evidence for a Melter for the two indexes
Number of cols in the Frame
Number of rows in the Frame
Outer product
Outer product
type of the other operand
result type of operation
other operand instance
implicit evidence for operation between this and other
In each column, replaces all NA values for which there is a non-NA value at a prior offset with the corresponding most-recent, non-NA value.
In each column, replaces all NA values for which there is a non-NA value at a prior offset with the corresponding most-recent, non-NA value. See Vec.pad
Same as above, but limits the number of observations padded.
Same as above, but limits the number of observations padded. See Vec.padAtMost
Pretty-printer for Frame, which simply outputs the result of stringify.
Pretty-printer for Frame, which simply outputs the result of stringify.
Number of rows to display
Number of cols to display
Access the raw (unboxed) value at an offset within the Frame
Access the raw (unboxed) value at an offset within the Frame
Integer row offset
Integer col offset
See concat; operates row-wise
See dropNA; operates row-wise
Apply a function to each column series which results in a single value, and return the series of results indexed by original column index.
Apply a function to each column series which results in a single value, and return the series of results indexed by original column index.
The output type of the function
Function taking a column (series) to a value
Create a new Frame whose indexes are formed from the provided arguments, and whose values are derived from the original Frame.
Create a new Frame whose indexes are formed from the provided arguments, and whose values are derived from the original Frame. Keys in the provided indices which do not map to existing values will map to NA in the new Frame.
Sequence of keys to be the row index of the result Frame
Sequence of keys to be the col index of the result Frame
Create a new Frame whose col index is formed of the provided argument, and whose values are derived from the original Frame.
Create a new Frame whose col index is formed of the provided argument, and whose values are derived from the original Frame.
Sequence of keys to be the col index of the result Frame
Create a new Frame whose row index is formed of the provided argument, and whose values are derived from the original Frame.
Create a new Frame whose row index is formed of the provided argument, and whose values are derived from the original Frame.
Sequence of keys to be the row index of the result Frame
Create a new Frame whose values are the same, but whose col index has been changed to the bound [0, numCols - 1), as in an array.
Create a new Frame whose values are the same, but whose row index has been changed to the bound [0, numRows - 1), as in an array.
See filter; operates row-wise
See filterAt; operates row-wise
See filterIx; operates row-wise
See join; operates row-wise
See joinAny; operates row-wise
See joinAnyPreserveColIx; operates row-wise
See joinAnyS; operates row-wise
See joinAnySPreserveColIx; operates row-wise
See joinPreserveColIx; operates row-wise
See joinS; operates row-wise
See joinSPreserveColIx; operates row-wise
See mapVec; operates row-wise
See mask; operates row-wise
See mask; operates row-wise
Produce a Frame each of whose columns are the result of executing a function on a sliding window of each column series.
Produce a Frame each of whose columns are the result of executing a function on a sliding window of each column series.
Result type of function
Window size
Function Series[X, T] => B to operate on sliding window
Create a Series by rolling over winSz number of rows of the Frame at a time, and applying a function that takes those rows to a single value.
Create a Series by rolling over winSz number of rows of the Frame at a time, and applying a function that takes those rows to a single value.
Result element type of Series
Window size to roll with
Function taking the (sub) frame to B
Given an array of row keys, slice out the corresponding row(s)
Given an array of row keys, slice out the corresponding row(s)
Array of keys
Given a Slice of type of row key, slice out corresponding row(s)
Given a Slice of type of row key, slice out corresponding row(s)
Slice containing appropriate key bounds
Given one or more row keys, slice out the corresponding row(s)
Given one or more row keys, slice out the corresponding row(s)
Row key(s) (sequence)
Access frame rows specified by a slice
Access frame rows specified by a slice
a slice specifier
Access frame rows at a particular integer offsets
Access frame rows at a particular integer offsets
an array of integer offsets
Access frame rows at a particular integer offsets
Access frame rows at a particular integer offsets
a sequence of integer offsets
Access frame row at a particular integer offset
Access frame row at a particular integer offset
integer offset
An index for the rows
Access frame rows between two integer offsets, [from, until)
Access frame rows between two integer offsets, [from, until)
Beginning offset
One past ending offset
Optional increment between offsets
Slice out a set of rows from the frame
Slice out a set of rows from the frame
Key from which to begin slicing
Key at which to end slicing
Whether to include 'to' key; true by default
Split Frame into two frames at row position r
Split Frame into two frames at row position r
Position at which to split Frame
Split Frame into two frames at row key k
Split Frame into two frames at row key k
Key at which to split Frame
See reduce; operates row-wise
See squeeze; operates row-wise
See transform; operates row-wise
See where; operates row-wise
Create a new Frame using the current values but with the new col index.
Create a new Frame using the current values but with the new col index. Positions of the values do not change. Length of new index must be equal to number of cols.
Type of elements of new Index
A new Index
Create a new Frame using the current values but with the new row index.
Create a new Frame using the current values but with the new row index. Positions of the values do not change. Length of new index must be equal to number of rows.
Type of elements of new Index
A new Index
Shift the sequence of values relative to the row index by some offset, dropping those values which no longer associate with a key, and having those keys which no longer associate to a value instead map to NA.
Shift the sequence of values relative to the row index by some offset, dropping those values which no longer associate with a key, and having those keys which no longer associate to a value instead map to NA.
Number to shift
Create a new Frame whose cols are sorted according to the col index keys
Create a new Frame whose cols are sorted primarily on the values in the first row specified in the argument list, and then on the values in the next row, etc.
Create a new Frame whose cols are sorted primarily on the values in the first row specified in the argument list, and then on the values in the next row, etc.
Location of rows containing values to sort on
Create a new Frame whose cols are sorted by the result of a function acting on each col.
Create a new Frame whose cols are sorted by the result of a function acting on each col.
Result type of the function
Function from a single col (represented as series) to a value having an ordering
Create a new Frame whose rows are sorted according to the row index keys
Create a new Frame whose rows are sorted primarily on the values in the first column specified in the argument list, and then on the values in the next column, etc.
Create a new Frame whose rows are sorted primarily on the values in the first column specified in the argument list, and then on the values in the next column, etc.
Location of columns containing values to sort on
Create a new Frame whose rows are sorted by the result of a function acting on each row.
Create a new Frame whose rows are sorted by the result of a function acting on each row.
Result type of the function
Function from a single row (represented as series) to a value having an ordering
Drop all columns from the Frame which have nothing but NA values.
Stack pivots the innermost column labels to the innermost row labels.
Stack pivots the innermost column labels to the innermost row labels. That is, it splits a col index of tuple keys of arity N into a new col index having arity N-1 and a remaining index C, and forms a new row index by stacking the existing row index with C. The resulting Frame has values as in the original Frame indexed by the corresponding keys. It does the reverse of unstack.
The N-1 arity column index type
The 1-arity type of split-out index C
The type of the stacked row index
An implicit instance of Splitter to do the splitting
An implicit instance of Stacker to do the stacking
Creates a string representation of Frame
Creates a string representation of Frame
Max number of rows to include
Max number of rows to include
Extract last n rows
Extract last n rows
number of rows to extract
Extract last n columns
Extract last n columns
number of columns to extract
Produce an indexed sequence of pairs of column index value and column Series.
Extract the Mat embodied in the values of the Frame (dropping any indexing information)
Produce an indexed sequence of pairs of row index value and row Series
Produce an indexed sequence of triples of values in the Frame in row-major order.
Apply a function to each column series which results in another series (having possibly a different index); return new frame whose row index is the the full outer join of all the intermediately produced series (fast when all series have the same index), and having the original column index.
Apply a function to each column series which results in another series (having possibly a different index); return new frame whose row index is the the full outer join of all the intermediately produced series (fast when all series have the same index), and having the original column index.
Type of values of result series of function
Type of index of result series of function
Function to operate on each column as a series
Unstack pivots the innermost row labels to the innermost col labels.
Unstack pivots the innermost row labels to the innermost col labels. That is, it splits a row index of tuple keys of arity N into a new row index having arity N-1 and a remaining index R, and forms a new col index by stacking the existing col index with R. The resulting Frame has values as in the original Frame indexed by the corresponding keys.
For example:
scala> Frame(Series(Vec(1,2,3,4), Index(('a',1),('a',2),('b',1),('b',2))), Series(Vec(5,6,7,8), Index(('a',1),('a',2),('b',1),('b',2)))) res1: org.saddle.Frame[(Char, Int),Int,Int] = [4 x 2] 0 1 -- -- a 1 -> 1 5 2 -> 2 6 b 1 -> 3 7 2 -> 4 8 scala> res1.unstack res2: org.saddle.Frame[Char,(Int, Int),Int] = [2 x 4] 0 1 1 2 1 2 -- -- -- -- a -> 1 2 5 6 b -> 3 4 7 8
The N-1 arity row index type
The 1-arity type of split-out index R
The type of the stacked col index
An implicit instance of Splitter to do the splitting
An implicit instance of Stacker to do the stacking
Create Frame whose rows satisfy the rule that their keys and values are chosen via a Vec[Boolean] or a Series[_, Boolean] predicate when the latter contains a true value.
Create Frame whose rows satisfy the rule that their keys and values are chosen via a Vec[Boolean] or a Series[_, Boolean] predicate when the latter contains a true value.
Series[_, Boolean] (or Vec[Boolean] which will implicitly convert)
Overloaded method to create hierarchical index from two rows.
Create a new Frame using the current values but with the new col index specified by the row at a particular offset, and with that row removed from the frame data body.
Overloaded method to create hierarchical index from two cols.
Create a new Frame using the current values but with the new row index specified by the column at a particular offset, and with that column removed from the frame data body.
Logical EXCLUSIVE OR
Logical EXCLUSIVE OR
type of the other operand
result type of operation
other operand instance
implicit evidence for operation between this and other
Bit-wise OR
Bit-wise OR
type of the other operand
result type of operation
other operand instance
implicit evidence for operation between this and other
Logical OR
Logical OR
type of the other operand
result type of operation
other operand instance
implicit evidence for operation between this and other
Frame
is an immutable container for 2D data which is indexed along both axes (rows, columns) by associated keys (i.e., indexes).The primary use case is homogeneous data, but a secondary concern is to support heterogeneous data that is homogeneous ony within any given column.
The row index, column index, and constituent value data are all backed ultimately by arrays.
Frame
is effectively a doubly-indexed associative map whose row keys and col keys each have an ordering provided by the natural (provided) order of their backing arrays.Several factory and access methods are provided. In the following examples, assume that:
The
apply
method takes a row and col key returns a slice of the original Frame:apply
also accepts a Slice:You may slice using the
col
androw
methods respectively, as follows:You can achieve a similar effect with
rowSliceBy
andcolSliceBy
The
colAt
androwAt
methods take an integer offset i into the Frame, and return a Series indexed by the opposing axis:If there is a one-to-one relationship between offset i and key (ie, no duplicate keys in the index), you may achieve the same effect via key as follows:
The
at
method returns an instance of a Scalar, which behaves much like anOption
; it can be either an instance of org.saddle.scalar.NA or a Value case class:The
rowSlice
andcolSlice
methods allows slicing the Frame for locations in [i, j) irrespective of the value of the keys at those locations.Finally, the method
raw
accesses a value directly, which may reveal the underlying representation of a missing value (so be careful).Frame
may be used in arithmetic expressions which operate on twoFrame
s or on aFrame
and a scalar value. In the former case, the two Frames will automatically align along their indexes:The type of row keys
The type of column keys
The type of entries in the frame