org.saddle.index
Members list
Type members
Classlikes
An implementation of org.saddle.Index generic in type T for which there is an Ordering[T] and a ST[T] available in the implicit context.
An implementation of org.saddle.Index generic in type T for which there is an Ordering[T] and a ST[T] available in the implicit context.
Attributes
- Supertypes
Index with double keys
Index with double keys
Attributes
- Supertypes
Index with integer keys
Index with integer keys
Attributes
- Supertypes
An implementation of an Index[Int] which implicitly represents a bound of integers, which lazily generates its elements as an array when needed. This compact representation is the default when creating a Saddle object such as org.saddle.Series which requires an index and one is not supplied.
An implementation of an Index[Int] which implicitly represents a bound of integers, which lazily generates its elements as an array when needed. This compact representation is the default when creating a Saddle object such as org.saddle.Series which requires an index and one is not supplied.
Attributes
- Companion
- object
- Supertypes
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
IndexIntRange.type
Index with long keys
An IndexMaker takes some input of type I and returns an Index whose elements are of type O.
An IndexMaker takes some input of type I and returns an Index whose elements are of type O.
The basic use case is to take a Tuple,,N,, of Seq-like instances and return an Index whose entries are instances of Tuple,,N,, corresponding to the elements of the original Seqs.
Type parameters
- I
-
Type of input with which to make index
- O
-
Type of contents of output index
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
Companion object which houses implicit instances of IndexMaker
Companion object which houses implicit instances of IndexMaker
Attributes
- Companion
- trait
- Supertypes
- Self type
-
IndexMaker.type
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
object IndexMaker.type
There are four basic joins which may be performed between two indexed Saddle objects such as org.saddle.Series or org.saddle.Frame.
There are four basic joins which may be performed between two indexed Saddle objects such as org.saddle.Series or org.saddle.Frame.
- InnerJoin
- OuterJoin (also known as a full join)
- LeftJoin
- RightJoin
These are defined analogously to SQL joins.
For example, an output key will be generated in the following situations:
- Inner: key exists in both input indexes
- Outer: key exists in either or both input indexes
- Left: key exists in left or both input indexes
- Right: key exists in right or both input indexes
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
Concrete implementation of Joiner instance which is specialized on basic types.
Concrete implementation of Joiner instance which is specialized on basic types.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
A Melter operates on a Tuple,,N,, and a Tuple,,M,, and produces a Tuple,,N+M,, which is composed of the corresponding tuple elements.
A Melter operates on a Tuple,,N,, and a Tuple,,M,, and produces a Tuple,,N+M,, which is composed of the corresponding tuple elements.
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
Normal priority melter implicit instances takes one a Tuple,,N,, and a Tuple,,M,, and produce a Tuple,,N+M,,
Normal priority melter implicit instances takes one a Tuple,,N,, and a Tuple,,M,, and produce a Tuple,,N+M,,
Attributes
Next lowest priority melter implicit instances; takes one arbitrary types and a Tuple,,N,, and produces a Tuple,,N+1,,
Next lowest priority melter implicit instances; takes one arbitrary types and a Tuple,,N,, and produces a Tuple,,N+1,,
Attributes
- Supertypes
- Known subtypes
-
object Melter.type
Lowest priority melter implicit instance takes two arbitrary types and produces a Tuple2
Lowest priority melter implicit instance takes two arbitrary types and produces a Tuple2
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
trait MelterLowPriorityobject Melter.type
We often need to "reindex" one array/vec/series/frame so as to produce a new one.
We often need to "reindex" one array/vec/series/frame so as to produce a new one.
First, note that an array A of values of type T is actually a mapping defined as
f
[0, A.length) => {T}
That is, each integer index of the array yields a value of type T when it is de-referenced.
ReIndexer has two fields, lTake and rTake, which are array-based maps defined for some integers M and N as
g
[0, N) => [-1, M)
In other words, lTake and rTake are arrays of length N whose entries are integers between -1 and M-1. We call these "indexers".
Given a reindexer, g, a re-indexing operation on array A yields a new array B of length N which represents the following mapping:
B
[0, N) => {T}
where B(i) == f(g(i)) if g(i) != -1
== NA if g(i) == -1
For this to work, the maximum value M in the co-domain of g must be <= A.length. We also augment the mapping f to send -1 to the corresponding NA value of type T.
For example, suppose we have Index(0,1,2,4) and Index(0,1,2,3). Performing a full outer join would yield the following ReIndexer:
- lTake = {0, 1, 2, -1, 3},
- rTake = {0, 1, 2, 3, -1},
- index = Index(0, 1, 2, 3, 4).
These indexers are then amenable to using with org.saddle.array.take to select elements out of an indexed data structure.
A performance optimization is to make lTake and rTake of type Option[Array], where we make a value of None behave as if it were an array of [0, N). So, the "taking" code knows to take the original values. You will therefore see code that looks like:
val v = Vec(...)
val ixer = ReIndexer(...)
ixer.lTake.map(x => v.take(x)) getOrElse v
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
Slice provides a methodology so that when it is applied to an index, it produces an lower (inclusive) and upper (exclusive) integer offset at which to slice.
Slice provides a methodology so that when it is applied to an index, it produces an lower (inclusive) and upper (exclusive) integer offset at which to slice.
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
Represent a slice from one key to another, inclusive.
Represent a slice from one key to another, inclusive.
Type parameters
- T
-
Type of Key
Value parameters
- k1
-
First key
- k2
-
Second key
Attributes
- Supertypes
A Splitter operates on an input index whose elements have arity N, and yields the following pair of output indexes: the left has elements whose arity is N-1, where each element has the first N-1 constituents of the original tuple; and the right is an index whose elements were those in the Nth position of the original tuple.
A Splitter operates on an input index whose elements have arity N, and yields the following pair of output indexes: the left has elements whose arity is N-1, where each element has the first N-1 constituents of the original tuple; and the right is an index whose elements were those in the Nth position of the original tuple.
For example,
Index[(Char, Int)](('a', 1), ('a', 2), ('b', 1), ('b', 2)).split
yields
(Index[Char]('a', 'a', 'b', 'b'), Index[Int](1, 2, 1, 2))
Type parameters
- I
-
Input index whose elements have arity > 1
- OL
-
Left output index whose elements have arity >= 1
- OR
-
Right output index whose elements have arity 1
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
A Stacker operates on two input Index instances and produces a new output Index whose entries are drawn from the Cartesian product of the elements of the original indexes, and whose ordering is likewise specified by the original orderings. For instance,
A Stacker operates on two input Index instances and produces a new output Index whose entries are drawn from the Cartesian product of the elements of the original indexes, and whose ordering is likewise specified by the original orderings. For instance,
Index[Int](1,2) stack Index[Char]('a','b')
results in
Index[(Int, Char)]((1,'a'), (1,'b'), (2,'a'), (2,'b'))
whereas
Index[(Char, Int)](('x',1), ('y',2)) stack Index[Char]('a','b')
results in
Index[(Char, Int, Char)](('x',1,'a'), ('x',1,'b'), ('y',2,'a'), ('y',2,'b'))
Type parameters
- I
-
Type of the elements of the left index
- J
-
Type of the elements of the right index
- O
-
Type of the elements of the output index
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
Companion object which houses implicit Stacker instances.
Companion object which houses implicit Stacker instances.
Attributes
Implicit instance of Stacker for two indexes of arbitrary type. The priority is lower than the Stacker instances in the Stacker companion object because we want to specialize the case when the left index is composed of Tuples.
Implicit instance of Stacker for two indexes of arbitrary type. The priority is lower than the Stacker instances in the Stacker companion object because we want to specialize the case when the left index is composed of Tuples.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
object Stacker.type