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:
val f = Frame('a'->Vec(1,2,3), 'b'->Vec(4,5,6))
The apply
method takes a row and col key returns a slice of the original
Frame:
f(0,'a') == Frame('a'->Vec(1))
apply
also accepts a org.saddle.index.Slice:
f(0->1, 'b') == Frame('b'->Vec(4,5))
f(0, *) == Frame('a'->Vec(1), 'b'->Vec(4))
You may slice using the col
and row
methods respectively, as follows:
f.col('a') == Frame('a'->Vec(1,2,3))
f.row(0) == Frame('a'->Vec(1), 'b'->Vec(4))
f.row(0->1) == Frame('a'->Vec(1,2), 'b'->Vec(4,5))
You can achieve a similar effect with rowSliceBy
and colSliceBy
The colAt
and rowAt
methods take an integer offset i into the Frame, and
return a Series indexed by the opposing axis:
f.rowAt(0) == Series('a'->1, 'b'->4)
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:
f.first(0) == Series('a'->1, 'b'->4)
f.firstCol('a') == Series(1,2,3)
The at
method returns an instance of a org.saddle.scalar.Scalar, which
behaves much like an Option
; it can be either an instance of
org.saddle.scalar.NA or a org.saddle.scalar.Value case class:
f.at(0, 0) == scalar.Scalar(1)
The rowSlice
and colSlice
methods allows slicing the Frame for locations
in [i, j) irrespective of the value of the keys at those locations.
f.rowSlice(0,1) == Frame('a'->Vec(1), 'b'->Vec(4))
Finally, the method raw
accesses a value directly, which may reveal the
underlying representation of a missing value (so be careful).
f.raw(0,0) == 1
Frame
may be used in arithmetic expressions which operate on two Frame
s
or on a Frame
and a scalar value. In the former case, the two Frames will
automatically align along their indexes:
f + f.shift(1) == Frame('a'->Vec(NA,3,5), 'b'->Vec(NA,9,11))
Attributes
- CX
The type of column keys
- RX
The type of row keys
- T
The type of entries in the frame
- colIx
An index for the columns
- rowIx
An index for the rows
- values
A sequence of Vecs which comprise the columns of the Frame
- Companion:
- object
- Graph
- Supertypes
Members list
Value members
Concrete methods
The transpose of the frame (swapping the axes)
The transpose of the frame (swapping the axes)
Attributes
Same as addCol
, but preserve the column index, adding the specified
index value, newColIx
as an index for the other
Series.
Same as addCol
, but preserve the column index, adding the specified
index value, newColIx
as an index for the other
Series.
Attributes
Add a new column. Resets column index
Add a new column. Resets column index
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.
Attributes
- how
How to perform the join
- other
Series to join with
See addCol, operates row-wise.
See addCol, operates row-wise.
Attributes
See addRow; operates row-wise.
See addRow; operates row-wise.
Attributes
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
Attributes
- chow
How to perform the join on the col indexes
- other
Other frame to align with
- rhow
How to perform the join on the row indexes
Slice frame by row and column slice specifiers
Slice frame by row and column slice specifiers
Attributes
- cix
A col slice
- rix
A row slice
Slice frame by row slice and array of column keys
Slice frame by row slice and array of column keys
Attributes
- cix
An array of column keys
- rix
A row slice
Slice frame by array of row keys and a col slice
Slice frame by array of row keys and a col slice
Attributes
- cix
A col slice
- rix
An array of row keys
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
Attributes
- cix
An array of col keys
- rix
An array of row keys
Access a (Scalar-boxed) value from within the Frame
Access a (Scalar-boxed) value from within the Frame
Attributes
- c
Integer col offset
- r
Integer row offset
Access a slice of the Frame by integer offsets
Access a slice of the Frame by integer offsets
Attributes
- c
Array of col offsets
- r
Array of row offsets
Access a slice of the Frame by integer offsets
Access a slice of the Frame by integer offsets
Attributes
- c
Integer col offset
- r
Array of row offsets
Access a slice of the Frame by integer offsets
Access a slice of the Frame by integer offsets
Attributes
- c
Array of col offsets
- r
Integer row offset
Access a slice of the Frame by Slice parameters
Access a slice of the Frame by Slice parameters
Attributes
- c
Slice to apply to cols
- r
Slice to apply to rows
Same as rconcat. Concatenates two Frames by concatenating their lists of columns A1 A2 rconcat B1 B2 = A1 A2 B1 B2 A3 A4 B3 B4 A3 A4 B3 B4
Same as rconcat. Concatenates two Frames by concatenating their lists of columns A1 A2 rconcat B1 B2 = A1 A2 B1 B2 A3 A4 B3 B4 A3 A4 B3 B4
Attributes
Given one or more column keys, slice out the corresponding column(s)
Given one or more column keys, slice out the corresponding column(s)
Attributes
- keys
Column key(s) (sequence)
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)
Attributes
- slice
Slice containing appropriate key bounds
Given an array of column keys, slice out the corresponding column(s)
Given an array of column keys, slice out the corresponding column(s)
Attributes
- keys
Array of keys
Access frame column at a particular integer offset
Access frame column at a particular integer offset
Attributes
- loc
integer offset
Access frame columns at a particular integer offsets
Access frame columns at a particular integer offsets
Attributes
- locs
a sequence of integer offsets
Access frame columns at a particular integer offsets
Access frame columns at a particular integer offsets
Attributes
- locs
an array of integer offsets
Access frame columns specified by a slice
Access frame columns specified by a slice
Attributes
- slice
a slice specifier
Access frame columns between two integer offsets, [from, until)
Access frame columns between two integer offsets, [from, until)
Attributes
- from
Beginning offset
- stride
Optional increment between offsets
- until
One past ending offset
Slice out a set of columns from the frame
Slice out a set of columns from the frame
Attributes
- from
Key from which to begin slicing
- inclusive
Whether to include 'to' key; true by default
- to
Key at which to end slicing
Split Frame into two frames at column position c
Split Frame into two frames at column position c
Attributes
- 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
Attributes
- k
Key at which to split Frame
k
is included in the right Frame [1,2,3,4] split at 2 yields [1] and [2,3,4]
Concatenate the Frame instances together (vertically, i.e. concatenate as
lists of rows) 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).
Concatenate the Frame instances together (vertically, i.e. concatenate as
lists of rows) 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).
A1 A2 concat B1 B2 = A1 A2 A3 A4 B3 B4 A3 A4 B1 B2 B3 B4
Attributes
- U
type of other Frame values
- V
type of resulting Frame values
- other
Frame[RX, CX, U] to concat
- pro
Implicit evidence of Promoter
Count of the elements of each column, ignoring NA values
Count of the elements of each column, ignoring NA values
Attributes
See shift; operates col-wise
See shift; operates col-wise
Attributes
Return the frame with the first occurence of each column key. Rows are not changed.
Return the frame with the first occurence of each column key. Rows are not changed.
Attributes
Return Frame excluding any of those columns which have an NA value
Return Frame excluding any of those columns which have an NA value
Attributes
Return empty series of type equivalent to a column of frame
Return empty series of type equivalent to a column of frame
Attributes
Return empty series of type equivalent to a row of frame
Return empty series of type equivalent to a row of frame
Attributes
Compares the receiver object (this
) with the argument object (that
) for equivalence.
Compares the receiver object (this
) with the argument object (that
) for equivalence.
Any implementation of this method should be an equivalence relation:
- It is reflexive: for any instance
x
of typeAny
,x.equals(x)
should returntrue
. - It is symmetric: for any instances
x
andy
of typeAny
,x.equals(y)
should returntrue
if and only ify.equals(x)
returnstrue
. - It is transitive: for any instances
x
,y
, andz
of typeAny
ifx.equals(y)
returnstrue
andy.equals(z)
returnstrue
, thenx.equals(z)
should returntrue
.
If you override this method, you should verify that your implementation remains an equivalence relation.
Additionally, when overriding this method it is usually necessary to override hashCode
to ensure that
objects which are "equal" (o1.equals(o2)
returns true
) hash to the same scala.Int.
(o1.hashCode.equals(o2.hashCode)
).
Attributes
- that
the object to compare against this object for equality.
- Returns:
true
if the receiver object is equivalent to the argument;false
otherwise.- Definition Classes
- Any
Fill NAs with a defined value.
Fill NAs with a defined value.
Attributes
Fill NA values by propagating defined values column-wise.
Fill NA values by propagating defined values column-wise.
Attributes
- limit
If > 0, propagate over a maximum of
limit
consecutive NA values.
Return Frame whose columns satisfy a predicate function operating on that column
Return Frame whose columns satisfy a predicate function operating on that column
Attributes
- pred
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
Attributes
- pred
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
Attributes
- pred
Predicate function from CX => Boolean
Extract first row matching a particular key
Extract first row matching a particular key
Attributes
- k
Key to match
Extract first col matching a particular key
Extract first col matching a particular key
Attributes
- k
Key to match
Map over each triple (r, c, v) in the Frame, flattening results, and returning a new frame from the resulting triples.
Map over each triple (r, c, v) in the Frame, flattening results, and returning a new frame from the resulting triples.
Attributes
Return scalar of first row and column found
Return scalar of first row and column found
Attributes
- c
Column to match
- r
Row to match
Construct a org.saddle.groupby.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.
Construct a org.saddle.groupby.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.
Attributes
Construct a org.saddle.groupby.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.
Construct a org.saddle.groupby.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.
Attributes
- Y
Type of function codomain
- fn
Function from RX => Y
Construct a org.saddle.groupby.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.
Construct a org.saddle.groupby.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.
Attributes
- Y
Type of elements of ix
- ix
Index with which to perform grouping
Calculate a hash code value for the object.
Calculate a hash code value for the object.
The default hashing algorithm is platform dependent.
Note that it is allowed for two objects to have identical hash codes (o1.hashCode.equals(o2.hashCode)
) yet
not be equal (o1.equals(o2)
returns false
). A degenerate implementation could always return 0
.
However, it is required that if two objects are equal (o1.equals(o2)
returns true
) that they have
identical hash codes (o1.hashCode.equals(o2.hashCode)
). Therefore, when overriding this method, be sure
to verify that the behavior is consistent with the equals
method.
Attributes
- Returns:
the hash code value for this object.
- Definition Classes
- Any
Extract first n rows
Extract first n rows
Attributes
- n
number of rows to extract
Extract first n columns
Extract first n columns
Attributes
- n
number of columns to extract
Returns true if there are no values in the Frame
Returns true if there are no values in the Frame
Attributes
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.
Attributes
- U
The type of other frame values
- V
The result type of the function
- chow
The type of join to effect on the cols
- f
The function to apply
- other
Other Frame
- rhow
The type of join to effect on the rows
Extract last row matching a particular key
Extract last row matching a particular key
Attributes
- k
Key to match
Extract first col matching a particular key
Extract first col matching a particular key
Attributes
- k
Key to match
Map over each triple (r, c, v) in the Frame, returning a new frame from the resulting triples.
Map over each triple (r, c, v) in the Frame, returning a new frame from the resulting triples.
Attributes
Map a function over the col index, resulting in a new Frame
Map a function over the col index, resulting in a new Frame
Attributes
- Y
Result type of index, ie Index[Y]
- fn
The function CX => Y with which to map
Map a function over the columns, resulting in a new Frame
Map a function over the columns, resulting in a new Frame
Attributes
- Y
Result type of mapped value
- fn
The function (CX,Vec[T]) => Vec[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
Attributes
- Y
Result type of index, ie Index[Y]
- fn
The function RX => Y with which to map
Map a function over the rows, resulting in a new Frame
Map a function over the rows, resulting in a new Frame
Attributes
- Y
Result type of mapped value
- fn
The function (RX,Vec[T]) => Vec[Y] with which to map
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.
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.
Attributes
- U
The type of the resulting values
- f
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.
Attributes
- U
Type of result Vec of the function
- f
Function acting on Vec[T] and producing another Vec
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
Attributes
- f
Function from T to Boolean
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
Attributes
- m
Mask Vec[Boolean]
Max of the elements of each column, ignoring NA values
Max of the elements of each column, ignoring NA values
Attributes
Mean of each column
Mean of each column
Attributes
Median of each column
Median of each column
Attributes
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
Attributes
- W
Output type (tuple of arity N + M)
- melter
Implicit evidence for a Melter for the two indexes
Min of the elements of each column, ignoring NA values
Min of the elements of each column, ignoring NA values
Attributes
Number of cols in the Frame
Number of cols in the Frame
Attributes
Number of rows in the Frame
Number of rows in the Frame
Attributes
Pretty-printer for Frame, which simply outputs the result of stringify.
Pretty-printer for Frame, which simply outputs the result of stringify.
Attributes
- ncols
Number of cols to display
- nrows
Number of rows to display
Product of the elements of each column, ignoring NA values
Product of the elements of each column, ignoring NA values
Attributes
Access the raw (unboxed) value at an offset within the Frame
Access the raw (unboxed) value at an offset within the Frame
Attributes
- c
Integer col offset
- r
Integer row offset
Same as concat. Concatenates two Frames by concatenating their lists of rows A1 A2 concat B1 B2 = A1 A2 A3 A4 B3 B4 A3 A4 B1 B2 B3 B4
Same as concat. Concatenates two Frames by concatenating their lists of rows A1 A2 concat B1 B2 = A1 A2 A3 A4 B3 B4 A3 A4 B1 B2 B3 B4
Attributes
See concat; operates row-wise. Concetanates two Frames by concatenating their lists of columns A1 A2 rconcat B1 B2 = A1 A2 B1 B2 A3 A4 B3 B4 A3 A4 B3 B4
See concat; operates row-wise. Concetanates two Frames by concatenating their lists of columns A1 A2 rconcat B1 B2 = A1 A2 B1 B2 A3 A4 B3 B4 A3 A4 B3 B4
Attributes
Return the series with the first occurence of each row key. Columns are not changed.
Return the series with the first occurence of each row key. Columns are not changed.
Attributes
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.
Attributes
- U
The output type of the function
- f
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. Keys in the provided indices which do not map to existing values will map to NA in the new 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.
Attributes
- cix
Sequence of keys to be the col index of the result Frame
- rix
Sequence of keys to be the row 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.
Attributes
- cix
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.
Attributes
- rix
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 col index has been changed to the bound [0, numCols - 1), as in an array.
Attributes
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.
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.
Attributes
See filter; operates row-wise
See filter; operates row-wise
Attributes
See filterAt; operates row-wise
See filterAt; operates row-wise
Attributes
See filterIx; operates row-wise
See filterIx; operates row-wise
Attributes
See mapVec; operates row-wise
See mapVec; operates row-wise
Attributes
See mask; operates row-wise
See mask; operates row-wise
Attributes
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.
Attributes
- B
Result type of function
- f
Function Series[X, T] => B to operate on sliding window
- winSz
Window size
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.
Attributes
- B
Result element type of Series
- f
Function taking the (sub) frame to B
- winSz
Window size to roll with
Given one or more row keys, slice out the corresponding row(s)
Given one or more row keys, slice out the corresponding row(s)
Attributes
- keys
Row key(s) (sequence)
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)
Attributes
- slice
Slice containing appropriate key bounds
Given an array of row keys, slice out the corresponding row(s)
Given an array of row keys, slice out the corresponding row(s)
Attributes
- keys
Array of keys
Access frame row at a particular integer offset
Access frame row at a particular integer offset
Attributes
- loc
integer offset
Access frame rows at a particular integer offsets
Access frame rows at a particular integer offsets
Attributes
- locs
a sequence of integer offsets
Access frame rows at a particular integer offsets
Access frame rows at a particular integer offsets
Attributes
- locs
an array of integer offsets
Access frame rows specified by a slice
Access frame rows specified by a slice
Attributes
- slice
a slice specifier
Access frame rows between two integer offsets, [from, until)
Access frame rows between two integer offsets, [from, until)
Attributes
- from
Beginning offset
- stride
Optional increment between offsets
- until
One past ending offset
Slice out a set of rows from the frame
Slice out a set of rows from the frame
Attributes
- from
Key from which to begin slicing
- inclusive
Whether to include 'to' key; true by default
- to
Key at which to end slicing
Split Frame into two frames at row position r
Split Frame into two frames at row position r
Attributes
- 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
Attributes
- k
Key at which to split Frame
See reduce; operates row-wise
See reduce; operates row-wise
Attributes
See squeeze; operates row-wise
See squeeze; operates row-wise
Attributes
See transform; operates row-wise
See transform; operates row-wise
Attributes
See where; operates row-wise
See where; operates row-wise
Attributes
See where; operates row-wise
See where; operates row-wise
Attributes
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.
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.
Attributes
- Y
Type of elements of new Index
- newIx
A new 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.
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.
Attributes
- Y
Type of elements of new Index
- newIx
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.
Attributes
- n
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 according to the col index keys
Attributes
Create a new Frame whose cols are sorted according to the reveverse of col index keys
Create a new Frame whose cols are sorted according to the reveverse of col index keys
Attributes
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.
Attributes
- locs
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.
Attributes
- Q
Result type of the function
- f
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 according to the row index keys
Attributes
Create a new Frame whose rows are sorted according to the reverse of row index keys
Create a new Frame whose rows are sorted according to the reverse of row index keys
Attributes
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.
Attributes
- locs
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.
Attributes
- Q
Result type of the function
- f
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.
Drop all columns from the Frame which have nothing but NA values.
Attributes
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.
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.
Attributes
- O1
The N-1 arity column index type
- O2
The 1-arity type of split-out index C
- V
The type of the stacked row index
- splt
An implicit instance of Splitter to do the splitting
- stkr
An implicit instance of Stacker to do the stacking
Creates a string representation of Frame
Creates a string representation of Frame
Attributes
- ncols
Max number of rows to include
- nrows
Max number of rows to include
Sum of the elements of each column, ignoring NA values
Sum of the elements of each column, ignoring NA values
Attributes
Extract last n rows
Extract last n rows
Attributes
- n
number of rows to extract
Extract last n columns
Extract last n columns
Attributes
- n
number of columns to extract
Produce an indexed sequence of pairs of column index value and column Series.
Produce an indexed sequence of pairs of column index value and column Series.
Attributes
Extract the Mat embodied in the values of the Frame (dropping any indexing information)
Extract the Mat embodied in the values of the Frame (dropping any indexing information)
Attributes
Produce an indexed sequence of pairs of row index value and row Series
Produce an indexed sequence of pairs of row index value and row Series
Attributes
Produce an indexed sequence of triples of values in the Frame in row-major order.
Produce an indexed sequence of triples of values in the Frame in row-major order.
Attributes
Returns a string representation of the object.
Returns a string representation of the object.
The default representation is platform dependent.
Attributes
- Returns:
a string representation of the object.
- Definition Classes
- Any
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.
Attributes
- SX
Type of index of result series of function
- U
Type of values of result series of function
- f
Function to operate on each column as a series
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.
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
Attributes
- O1
The N-1 arity row index type
- O2
The 1-arity type of split-out index R
- V
The type of the stacked col index
- splt
An implicit instance of Splitter to do the splitting
- stkr
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.
Attributes
- pred
Series[_, Boolean] (or Vec[Boolean] which will implicitly convert)
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.
Attributes
- pred
Series[_, Boolean] (or Vec[Boolean] which will implicitly convert)
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.
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.
Attributes
Overloaded method to create hierarchical index from two rows.
Overloaded method to create hierarchical index from two rows.
Attributes
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.
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.
Attributes
Overloaded method to create hierarchical index from two cols.
Overloaded method to create hierarchical index from two cols.
Attributes
Inherited methods
Integer modulus of division
Integer modulus of division
Attributes
- B
type of the other operand
- That
result type of operation
- op
implicit evidence for operation between this and other
- other
other operand instance (divisor)
- Inherited from:
- NumericOps
Attributes
- Inherited from:
- NumericOps
Bit-wise AND
Bit-wise AND
Attributes
- B
type of the other operand
- That
result type of operation
- op
implicit evidence for operation between this and other
- other
other operand instance
- Inherited from:
- NumericOps
Logical AND
Logical AND
Attributes
- B
type of the other operand
- That
result type of operation
- op
implicit evidence for operation between this and other
- other
other operand instance
- Inherited from:
- NumericOps
Multiplication
Multiplication
Attributes
- B
type of the other operand
- That
result type of operation
- op
implicit evidence for operation between this and other
- other
other operand instance
- Inherited from:
- NumericOps
Exponentiation
Exponentiation
Attributes
- B
type of the other operand
- That
result type of operation
- op
implicit evidence for operation between this and other
- other
other operand instance (exponent)
- Inherited from:
- NumericOps
Attributes
- Inherited from:
- NumericOps
Attributes
- Inherited from:
- NumericOps
Addition
Addition
Attributes
- B
type of the other operand
- That
result type of operation
- op
implicit evidence for operation between this and other
- other
other operand instance
- Inherited from:
- NumericOps
Attributes
- Inherited from:
- NumericOps
Subtraction
Subtraction
Attributes
- B
type of the other operand
- That
result type of operation
- op
implicit evidence for operation between this and other
- other
other operand instance
- Inherited from:
- NumericOps
Attributes
- Inherited from:
- NumericOps
Division
Division
Attributes
- B
type of the other operand
- That
result type of operation
- op
implicit evidence for operation between this and other
- other
other operand instance (divisor)
- Inherited from:
- NumericOps
Attributes
- Inherited from:
- NumericOps
Less-than comparison operator
Less-than comparison operator
Attributes
- B
type of the other operand
- That
result type of operation
- op
implicit evidence for operation between this and other
- other
other operand instance
- Inherited from:
- NumericOps
Bit-shift left
Bit-shift left
Attributes
- B
type of the other operand
- That
result type of operation
- op
implicit evidence for operation between this and other
- other
other operand instance
- Inherited from:
- NumericOps
Less-than-or-equal-to comparison operator
Less-than-or-equal-to comparison operator
Attributes
- B
type of the other operand
- That
result type of operation
- op
implicit evidence for operation between this and other
- other
other operand instance
- Inherited from:
- NumericOps
Element-wise inequality operator
Element-wise inequality operator
Attributes
- B
type of the other operand
- That
result type of operation
- op
implicit evidence for operation between this and other
- other
other operand instance
- Inherited from:
- NumericOps
Element-wise equality operator
Element-wise equality operator
Attributes
- B
type of the other operand
- That
result type of operation
- op
implicit evidence for operation between this and other
- other
other operand instance
- Inherited from:
- NumericOps
Greater-than comparison operator
Greater-than comparison operator
Attributes
- B
type of the other operand
- That
result type of operation
- op
implicit evidence for operation between this and other
- other
other operand instance
- Inherited from:
- NumericOps
Greater-than-or-equal-to comparison operator
Greater-than-or-equal-to comparison operator
Attributes
- B
type of the other operand
- That
result type of operation
- op
implicit evidence for operation between this and other
- other
other operand instance
- Inherited from:
- NumericOps
Bit-shift right (arithmetic)
Bit-shift right (arithmetic)
Attributes
- B
type of the other operand
- That
result type of operation
- op
implicit evidence for operation between this and other
- other
other operand instance
- Inherited from:
- NumericOps
Bit-shift right (logical)
Bit-shift right (logical)
Attributes
- B
type of the other operand
- That
result type of operation
- op
implicit evidence for operation between this and other
- other
other operand instance
- Inherited from:
- NumericOps
Bit-wise EXCLUSIVE OR
Bit-wise EXCLUSIVE OR
Attributes
- B
type of the other operand
- That
result type of operation
- op
implicit evidence for operation between this and other
- other
other operand instance
- Inherited from:
- NumericOps
Dot (inner) product
Dot (inner) product
Attributes
- B
type of the other operand
- That
result type of operation
- op
implicit evidence for operation between this and other
- other
other operand instance
- Inherited from:
- NumericOps
Outer product
Outer product
Attributes
- B
type of the other operand
- That
result type of operation
- op
implicit evidence for operation between this and other
- other
other operand instance
- Inherited from:
- NumericOps
Logical EXCLUSIVE OR
Logical EXCLUSIVE OR
Attributes
- B
type of the other operand
- That
result type of operation
- op
implicit evidence for operation between this and other
- other
other operand instance
- Inherited from:
- NumericOps
Bit-wise OR
Bit-wise OR
Attributes
- B
type of the other operand
- That
result type of operation
- op
implicit evidence for operation between this and other
- other
other operand instance
- Inherited from:
- NumericOps
Logical OR
Logical OR
Attributes
- B
type of the other operand
- That
result type of operation
- op
implicit evidence for operation between this and other
- other
other operand instance
- Inherited from:
- NumericOps