class Series[X, T] extends NumericOps[Series[X, T]]
Series
is an immutable container for 1D homogeneous data which is indexed
by a an associated sequence of keys.
Both the index and value data are backed by arrays.
Series
is effectively an associative map whose keys have an ordering
provided by the natural (provided) order of the backing array.
Several element access methods are provided.
The apply
method returns a slice of the original Series:
val s = Series(Vec(1,2,3,4), Index('a','b','b','c')) s('a') == Series('a'->1) s('b') == Series('b'->2, 'b'->3)
Other ways to slice a series involve implicitly constructing an org.saddle.index.Slice object and passing it to the Series apply method:
s('a'->'b') == Series('a'->1, 'b'->2, 'b'->3) s(* -> 'b') == Series('a'->1, 'b'->2, 'b'->3) s('b' -> *) == Series('b'->2, 'b'->3, 'c'->4) s(*) == s
The at
method returns an instance of a org.saddle.scalar.Scalar, which
behaves much like an Option
in that it can be either an instance of
org.saddle.scalar.NA or a org.saddle.scalar.Value case class:
s.at(0) == Scalar(1)
The slice
method allows slicing the Series for locations in [i, j)
irrespective of the value of the keys at those locations.
s.slice(2,4) == Series('b'->3, 'c'->4)
To slice explicitly by labels, use the sliceBy
method, which is inclusive
of the key boundaries:
s.sliceBy('b','c') == Series('b'->3, 'c'->4)
The method raw
accesses the value directly, which may reveal the
underlying representation of a missing value (so be careful).
s.raw(0) == 1
Series
may be used in arithmetic expressions which operate on two Series
or on a Series
and a scalar value. In the former case, the two Series will
automatically align along their indexes. A few examples:
s * 2 == Series('a'->2, 'b'->4, ... ) s + s.shift(1) == Series('a'->NA, 'b'->3, 'b'->5, ...)
- X
Type of elements in the index, for which there must be an implicit Ordering and ST
- T
Type of elements in the values array, for which there must be an implicit ST
- Alphabetic
- By Inheritance
- Series
- NumericOps
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
%[B, That](other: B)(implicit op: BinOp[Mod, Series[X, T], B, That]): That
Integer modulus of division
Integer modulus of division
- B
type of the other operand
- That
result type of operation
- other
other operand instance (divisor)
- op
implicit evidence for operation between this and other
- Definition Classes
- NumericOps
-
def
%=[B](other: B)(implicit op: BinOpInPlace[Mod, Series[X, T], B]): Unit
- Definition Classes
- NumericOps
-
def
&[B, That](other: B)(implicit op: BinOp[BitAnd, Series[X, T], B, That]): That
Bit-wise AND
Bit-wise AND
- B
type of the other operand
- That
result type of operation
- other
other operand instance
- op
implicit evidence for operation between this and other
- Definition Classes
- NumericOps
-
def
&&[B, That](other: B)(implicit op: BinOp[AndOp, Series[X, T], B, That]): That
Logical AND
Logical AND
- B
type of the other operand
- That
result type of operation
- other
other operand instance
- op
implicit evidence for operation between this and other
- Definition Classes
- NumericOps
-
def
*[B, That](other: B)(implicit op: BinOp[Multiply, Series[X, T], B, That]): That
Multiplication
Multiplication
- B
type of the other operand
- That
result type of operation
- other
other operand instance
- op
implicit evidence for operation between this and other
- Definition Classes
- NumericOps
-
def
**[B, That](other: B)(implicit op: BinOp[Power, Series[X, T], B, That]): That
Exponentiation
Exponentiation
- B
type of the other operand
- That
result type of operation
- other
other operand instance (exponent)
- op
implicit evidence for operation between this and other
- Definition Classes
- NumericOps
-
def
**=[B](other: B)(implicit op: BinOpInPlace[Power, Series[X, T], B]): Unit
- Definition Classes
- NumericOps
-
def
*=[B](other: B)(implicit op: BinOpInPlace[Multiply, Series[X, T], B]): Unit
- Definition Classes
- NumericOps
-
def
+[B, That](other: B)(implicit op: BinOp[Add, Series[X, T], B, That]): That
Addition
Addition
- B
type of the other operand
- That
result type of operation
- other
other operand instance
- op
implicit evidence for operation between this and other
- Definition Classes
- NumericOps
-
def
+=[B](other: B)(implicit op: BinOpInPlace[Add, Series[X, T], B]): Unit
- Definition Classes
- NumericOps
-
def
-[B, That](other: B)(implicit op: BinOp[Subtract, Series[X, T], B, That]): That
Subtraction
Subtraction
- B
type of the other operand
- That
result type of operation
- other
other operand instance
- op
implicit evidence for operation between this and other
- Definition Classes
- NumericOps
-
def
-=[B](other: B)(implicit op: BinOpInPlace[Subtract, Series[X, T], B]): Unit
- Definition Classes
- NumericOps
-
def
/[B, That](other: B)(implicit op: BinOp[Divide, Series[X, T], B, That]): That
Division
Division
- B
type of the other operand
- That
result type of operation
- other
other operand instance (divisor)
- op
implicit evidence for operation between this and other
- Definition Classes
- NumericOps
-
def
/=[B](other: B)(implicit op: BinOpInPlace[Divide, Series[X, T], B]): Unit
- Definition Classes
- NumericOps
-
def
<[B, That](other: B)(implicit op: BinOp[LtOp, Series[X, T], B, That]): That
Less-than comparison operator
Less-than comparison operator
- B
type of the other operand
- That
result type of operation
- other
other operand instance
- op
implicit evidence for operation between this and other
- Definition Classes
- NumericOps
-
def
<<[B, That](other: B)(implicit op: BinOp[BitShl, Series[X, T], B, That]): That
Bit-shift left
Bit-shift left
- B
type of the other operand
- That
result type of operation
- other
other operand instance
- op
implicit evidence for operation between this and other
- Definition Classes
- NumericOps
-
def
<=[B, That](other: B)(implicit op: BinOp[LteOp, Series[X, T], B, That]): That
Less-than-or-equal-to comparison operator
Less-than-or-equal-to comparison operator
- B
type of the other operand
- That
result type of operation
- other
other operand instance
- op
implicit evidence for operation between this and other
- Definition Classes
- NumericOps
-
def
<>[B, That](other: B)(implicit op: BinOp[NeqOp, Series[X, T], B, That]): That
Element-wise inequality operator
Element-wise inequality operator
- B
type of the other operand
- That
result type of operation
- other
other operand instance
- op
implicit evidence for operation between this and other
- Definition Classes
- NumericOps
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
=?[B, That](other: B)(implicit op: BinOp[EqOp, Series[X, T], B, That]): That
Element-wise equality operator
Element-wise equality operator
- B
type of the other operand
- That
result type of operation
- other
other operand instance
- op
implicit evidence for operation between this and other
- Definition Classes
- NumericOps
-
def
>[B, That](other: B)(implicit op: BinOp[GtOp, Series[X, T], B, That]): That
Greater-than comparison operator
Greater-than comparison operator
- B
type of the other operand
- That
result type of operation
- other
other operand instance
- op
implicit evidence for operation between this and other
- Definition Classes
- NumericOps
-
def
>=[B, That](other: B)(implicit op: BinOp[GteOp, Series[X, T], B, That]): That
Greater-than-or-equal-to comparison operator
Greater-than-or-equal-to comparison operator
- B
type of the other operand
- That
result type of operation
- other
other operand instance
- op
implicit evidence for operation between this and other
- Definition Classes
- NumericOps
-
def
>>[B, That](other: B)(implicit op: BinOp[BitShr, Series[X, T], B, That]): That
Bit-shift right (arithmetic)
Bit-shift right (arithmetic)
- B
type of the other operand
- That
result type of operation
- other
other operand instance
- op
implicit evidence for operation between this and other
- Definition Classes
- NumericOps
-
def
>>>[B, That](other: B)(implicit op: BinOp[BitUShr, Series[X, T], B, That]): That
Bit-shift right (logical)
Bit-shift right (logical)
- B
type of the other operand
- That
result type of operation
- other
other operand instance
- op
implicit evidence for operation between this and other
- Definition Classes
- NumericOps
-
def
^[B, That](other: B)(implicit op: BinOp[BitXor, Series[X, T], B, That]): That
Bit-wise EXCLUSIVE OR
Bit-wise EXCLUSIVE OR
- B
type of the other operand
- That
result type of operation
- other
other operand instance
- op
implicit evidence for operation between this and other
- Definition Classes
- NumericOps
-
def
align[U](other: Series[X, U], how: JoinType = LeftJoin)(implicit arg0: ST[U]): (Series[X, T], Series[X, U])
Aligns this series with another series, returning the two series aligned to each others indexes according to the the provided parameter
Aligns this series with another series, returning the two series aligned to each others indexes according to the the provided parameter
- other
Other series to align with
- how
How to perform the join on the indexes
-
def
apply(slice: Slice[X]): Series[X, T]
Extract a Series whose keys respect the Slice provided.
Extract a Series whose keys respect the Slice provided. Returns a new Series whose key-value pairs maintain the original ordering.
- slice
Slice
-
def
apply(keys: X*): Series[X, T]
Extract a Series corresponding to those keys provided.
Extract a Series corresponding to those keys provided. Returns a new Series whose key-value pairs maintain the original ordering.
- keys
Sequence of keys
- def apply(keys: Vec[X]): Series[X, T]
-
def
apply(keys: Array[X]): Series[X, T]
Extract a Series corresponding to those keys provided.
Extract a Series corresponding to those keys provided. Returns a new Series whose key-value pairs maintain the original ordering.
- keys
Array of keys
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
at(locs: Int*): Series[X, T]
Access multiple locations of a Series, returning a new Series comprising those locations
Access multiple locations of a Series, returning a new Series comprising those locations
- locs
Sequence of Int
-
def
at(locs: Array[Int]): Series[X, T]
Access multiple locations of a Series, returning a new Series comprising those locations
Access multiple locations of a Series, returning a new Series comprising those locations
- locs
Array of int offsets into Series
-
def
at(loc: Int): Scalar[T]
Access a boxed element of a Series at a single location
Access a boxed element of a Series at a single location
- loc
offset into Series
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
concat(other: Series[X, T]): Series[X, T]
Concatenate two Series instances together whose indexes share the same type of element, and where there exists some way to join the values of the Series.
Concatenate two Series instances together whose indexes share the same type of element, and where there exists some way to join the values of the Series. For instance, Series[X, Double]
concat
Series[X, Int] will promote Int to Double as a result of the implicit existence of a Promoter[Double, Int, Double] instance. The result Index will simply be the concatenation of the two input Indexes.- other
Series[X, B] to concat
-
def
contains(key: X): Boolean
Returns true if the index of the Series contains the key
Returns true if the index of the Series contains the key
- key
The key to check
- def count: Int
- def countif(test: (T) ⇒ Boolean): Int
-
def
distinctIx: Series[X, T]
Return the series with the first occurence of each key
-
def
dot[B, That](other: B)(implicit op: BinOp[InnerProd, Series[X, T], B, That]): That
Dot (inner) product
Dot (inner) product
- B
type of the other operand
- That
result type of operation
- other
other operand instance
- op
implicit evidence for operation between this and other
- Definition Classes
- NumericOps
-
def
dropNA: Series[X, T]
Creates a Series having the same values but excluding all key/value pairs in which the value is NA.
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(other: Any): Boolean
- Definition Classes
- Series → AnyRef → Any
-
def
exists(pred: (T) ⇒ Boolean): Boolean
Return true if there exists some element of the Series which satisfies the predicate function
Return true if there exists some element of the Series which satisfies the predicate function
- pred
Predicate function from T => Boolean
-
def
fillNA(f: (X) ⇒ T): Series[X, T]
Fills NA values in series with result of a function which acts on the index of the particular NA value found
Fills NA values in series with result of a function which acts on the index of the particular NA value found
- f
A function X => A to be applied at NA location
-
def
filter(pred: (T) ⇒ Boolean): Series[X, T]
Return Series whose values satisfy a predicate function
Return Series whose values satisfy a predicate function
- pred
Predicate function from T => Boolean
-
def
filterAt(pred: (Int) ⇒ Boolean): Series[X, T]
Return Series whose offets satisfy a predicate function
Return Series whose offets satisfy a predicate function
- pred
Predicate function from Int => Boolean
-
def
filterIx(pred: (X) ⇒ Boolean): Series[X, T]
Return Series whose index keys satisfy a predicate function
Return Series whose index keys satisfy a predicate function
- pred
Predicate function from X => Boolean
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
find(pred: (T) ⇒ Boolean): Vec[Int]
Search for the int offsets where the values of the Series satisfy a predicate function.
Search for the int offsets where the values of the Series satisfy a predicate function.
- pred
Function from T to Boolean
-
def
findKey(pred: (T) ⇒ Boolean): Index[X]
Search for the keys of the Series index whose corresponding values satisfy a predicate function.
Search for the keys of the Series index whose corresponding values satisfy a predicate function.
- pred
Function from T to Boolean
-
def
findOne(pred: (T) ⇒ Boolean): Int
Find the first int offset (or -1 if none) where a value of the Series satisfies a predicate function.
Find the first int offset (or -1 if none) where a value of the Series satisfies a predicate function.
- pred
Function from T to Boolean
-
def
findOneKey(pred: (T) ⇒ Boolean): Scalar[X]
Find the first key (or NA if none) where a value of the Series satisfies a predicate function.
Find the first key (or NA if none) where a value of the Series satisfies a predicate function.
- pred
Function from T to Boolean
-
def
first(key: X): Scalar[T]
Get the first value of the Series whose key matches that provided
Get the first value of the Series whose key matches that provided
- key
Key on which to match
-
def
first: Scalar[T]
Get the first value of the Series
-
def
firstKey: Scalar[X]
Get the first key of the Series
-
def
flatMap[Y, U](f: ((X, T)) ⇒ Iterable[(Y, U)])(implicit arg0: ST[Y], arg1: ORD[Y], arg2: ST[U]): Series[Y, U]
Map and then flatten over the key-value pairs of the Series, resulting in a new Series.
-
def
get(key: X): Scalar[T]
Alias for
first
.Alias for
first
. If a key exists, get the value associated with the first occurence of that key. -
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
groupBy[Y](ix: Index[Y])(implicit arg0: ST[Y], arg1: ORD[Y]): SeriesGrouper[Y, X, T]
Construct a org.saddle.groupby.SeriesGrouper with which further computations, such as combine or transform, may be performed.
Construct a org.saddle.groupby.SeriesGrouper 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.
- Y
Type of elements of ix
- ix
Index with which to perform grouping
-
def
groupBy[Y](fn: (X) ⇒ Y)(implicit arg0: ST[Y], arg1: ORD[Y]): SeriesGrouper[Y, X, T]
Construct a org.saddle.groupby.SeriesGrouper with which further computations, such as combine or transform, may be performed.
Construct a org.saddle.groupby.SeriesGrouper 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 Index; each unique result of calling the function on elements of the Index corresponds to a group.
- Y
Type of function codomain
- fn
Function from X => Y
-
def
groupBy: SeriesGrouper[X, X, T]
Construct a org.saddle.groupby.SeriesGrouper with which further computations, such as combine or transform, may be performed.
Construct a org.saddle.groupby.SeriesGrouper with which further computations, such as combine or transform, may be performed. The groups are constructed from the keys of the index, with each unique key corresponding to a group.
-
def
hasNA: Boolean
Return true if there is at least one NA value in the Series
-
def
hashCode(): Int
- Definition Classes
- Series → AnyRef → Any
-
def
head(n: Int): Series[X, T]
Extract at most the first n elements of the Series
Extract at most the first n elements of the Series
- n
Number of elements to extract
-
def
hjoin(other: Series[X, _], how: JoinType = LeftJoin): Frame[X, Int, Any]
Perform a (heterogeneous) join with another Series[X, _] according to its index.
Perform a (heterogeneous) join with another Series[X, _] according to its index. The values of the other Series do not need to have the same type. The result is a Frame whose index is the result of the join, and whose column index is {0, 1}, and whose values are sourced from the original Series.
- other
Series to join with
- how
How to perform the join
- val index: Index[X]
-
def
isEmpty: Boolean
True if and only if number of elements is zero
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
join(other: Series[X, T], how: JoinType = LeftJoin): Frame[X, Int, T]
Perform a join with another Series[X, T] according to its index.
Perform a join with another Series[X, T] according to its index. The
how
argument dictates how the join is to be performed:- Left org.saddle.index.LeftJoin
- Right org.saddle.index.RightJoin
- Inner org.saddle.index.InnerJoin
- Outer org.saddle.index.OuterJoin
The result is a Frame whose index is the result of the join, and whose column index is {0, 1}, and whose values are sourced from the original Series.
- other
Series to join with
- how
How to perform the join
-
def
joinF(other: Frame[X, _, T], how: JoinType = LeftJoin): Frame[X, Int, T]
Perform a join with a Frame[X, _, T] according to its row index.
Perform a join with a Frame[X, _, T] according to its row index. The values of the other Frame must have the same type as the Series. The result is a Frame whose row index is the result of the join, and whose column index is [0, N), corresponding to the number of columns of the frame plus 1, and whose values are sourced from the original Series and Frame.
- other
Frame[X, Any, T]
- how
How to perform the join
-
def
joinMap[U, V](other: Series[X, U], how: JoinType = LeftJoin)(f: (T, U) ⇒ V)(implicit arg0: ST[U], arg1: ST[V]): Series[X, V]
Join two series on their index and apply a function to each paired value; when either value is NA, the result of the function is forced to be NA.
Join two series on their index and apply a function to each paired value; when either value is NA, the result of the function is forced to be NA.
- U
Type of other series values
- V
The result type of the function
- other
Other series
- how
The type of join to effect
- f
The function to apply
-
def
keyAt(locs: Int*): Index[X]
Access a multiple locations of a Series index, returning a new Index
Access a multiple locations of a Series index, returning a new Index
- locs
Sequence of int offsets into Index
-
def
keyAt(locs: Array[Int]): Index[X]
Access a multiple locations of a Series index, returning a new Index
Access a multiple locations of a Series index, returning a new Index
- locs
array of int offset into Index
-
def
keyAt(loc: Int): Scalar[X]
Access a boxed element of a Series index at a single location
Access a boxed element of a Series index at a single location
- loc
offset into Series
-
def
last(key: X): Scalar[T]
Get the last value of the Series whose key matches that provided
Get the last value of the Series whose key matches that provided
- key
Key on which to match
-
def
last: Scalar[T]
Get the last value of the Series
-
def
lastKey: Scalar[X]
Get the last key of the Series
-
def
length: Int
The length shared by both the index and the values array
-
def
map[Y, U](f: ((X, T)) ⇒ (Y, U))(implicit arg0: ST[Y], arg1: ORD[Y], arg2: ST[U]): Series[Y, U]
Map over the key-value pairs of the Series, resulting in a new Series.
Map over the key-value pairs of the Series, resulting in a new Series. Applies a function to each pair of values in the series.
- Y
The type of the resulting index
- U
The type of the resulting values
- f
Function from (X,T) to (Y,U)
-
def
mapIndex[Y](fn: (X) ⇒ Y)(implicit arg0: ST[Y], arg1: ORD[Y]): Series[Y, T]
Map a function over the index, resulting in a new Series
Map a function over the index, resulting in a new Series
- Y
Result type of index, ie Index[Y]
- fn
The function X => Y with which to map
-
def
mapValues[U](f: (T) ⇒ U)(implicit arg0: ST[U]): Series[X, U]
Map over the values of the Series, resulting in a new Series.
Map over the values of the Series, resulting in a new Series. Applies a function to each (non-na) value in the series, returning a new series whose index remains the same.
- U
The type of the resulting values
- f
Function from T to U
-
def
mapVec[Y](fn: (Vec[T]) ⇒ Vec[Y])(implicit arg0: ST[Y]): Series[X, Y]
Map a function over the contents, resulting in a new Series
Map a function over the contents, resulting in a new Series
- Y
Result type of index, ie Index[Y]
- fn
The function T => Y with which to map
-
def
mask(f: (T) ⇒ Boolean): Series[X, T]
Create a new Series that, whenever the mask predicate function evaluates to true on a value, is masked with NA
Create a new Series that, whenever the mask predicate function evaluates to true on a value, is masked with NA
- f
Function from T to Boolean
-
def
mask(m: Vec[Boolean]): Series[X, T]
Create a new Series that, wherever the mask Vec is true, is masked with NA
Create a new Series that, wherever the mask Vec is true, is masked with NA
- m
Mask Vec[Boolean]
-
def
maskIx(f: (X) ⇒ Boolean): Series[X, T]
Create a new Series that, whenever the mask predicate function evaluates to true on a key, is masked with NA
Create a new Series that, whenever the mask predicate function evaluates to true on a key, is masked with NA
- f
Function from X to Boolean
- def max(implicit na: NUM[T]): Scalar[T]
-
def
maxKey(implicit num: NUM[T]): Scalar[X]
Return key corresponding to maximum value in series
- def median(implicit na: NUM[T]): Double
- def min(implicit na: NUM[T]): Scalar[T]
-
def
minKey(implicit num: NUM[T]): Scalar[X]
Return key corresponding to minimum value in series
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
outer[B, That](other: B)(implicit op: BinOp[OuterProd, Series[X, T], B, That]): That
Outer product
Outer product
- B
type of the other operand
- That
result type of operation
- other
other operand instance
- op
implicit evidence for operation between this and other
- Definition Classes
- NumericOps
-
def
pivot[O1, O2](implicit split: Splitter[X, O1, O2], ord1: ORD[O1], ord2: ORD[O2], m1: ST[O1], m2: ST[O2]): Frame[O1, O2, T]
Pivot splits an index of tuple keys of arity N into a row index having arity N-1 and a column index, producing a 2D Frame whose values are from the original Series as indexed by the corresponding keys.
Pivot splits an index of tuple keys of arity N into a row index having arity N-1 and a column index, producing a 2D Frame whose values are from the original Series as indexed by the corresponding keys.
To recover the original Series, the melt method of Frame may be used.
For example, given:
Series(Vec(1,2,3,4), Index(('a',1),('a',2),('b',1),('b',2))) res0: org.saddle.Series[(Char, Int),Int] = [4 x 1] a 1 => 1 2 => 2 b 1 => 3 2 => 4
the pivot command does the following:
res0.pivot res1: org.saddle.Frame[Char,Int,Int] = [2 x 2] 1 2 -- -- a => 1 2 b => 3 4
- O1
Output row index
- O2
Output col index
- split
Implicit evidence of a Splitter for the index
- ord1
Implicit evidence of an ordering for O1
- ord2
Implicit evidence of an ordering for O2
- m1
Implicit evidence of a ST for O1
- m2
Implicit evidence of a ST for O2
-
def
print(len: Int = 10, stream: OutputStream = System.out): Unit
Pretty-printer for Series, which simply outputs the result of stringify.
Pretty-printer for Series, which simply outputs the result of stringify.
- len
Number of elements to display
-
def
proxyWith(proxy: Series[X, T])(implicit fn: (NA.type) ⇒ T): Series[X, T]
Fill series NA's with values using a secondary series
Fill series NA's with values using a secondary series
- proxy
The series containing the values to use
-
def
raw(loc: Int): T
Access an unboxed element of a Series at a single location
Access an unboxed element of a Series at a single location
- loc
offset into Series
-
def
reindex(keys: X*): Series[X, T]
Create a new Series whose index formed of the provided argument, and whose values are derived from the original Series.
Create a new Series whose index formed of the provided argument, and whose values are derived from the original Series.
- keys
Sequence of keys to be the index of the result series
-
def
reindex(newIx: Index[X]): Series[X, T]
Create a new Series whose index is the provided argument, and whose values are derived from the original Series.
Create a new Series whose index is the provided argument, and whose values are derived from the original Series.
- newIx
Index of the result series
-
def
resetIndex: Series[Int, T]
Create a new Series whose values are the same, but whose Index has been changed to the bound [0, length - 1), as in an array.
-
def
reversed: Series[X, T]
Create a new Series whose values and index keys are both in reversed order
-
def
rolling[B](winSz: Int, f: (Series[X, T]) ⇒ B)(implicit arg0: ST[B]): Series[X, B]
Produce a Series whose values are the result of executing a function on a sliding window of the data.
Produce a Series whose values are the result of executing a function on a sliding window of the data.
- B
Result type of function
- winSz
Window size
- f
Function Series[X, T] => B to operate on sliding window
-
def
scanLeft[U](init: U)(f: (U, T) ⇒ U)(implicit arg0: ST[U]): Series[X, U]
Left scan over the values of the Series, as in scala collections library, but with the resulting series having the same index.
Left scan over the values of the Series, as in scala collections library, but with the resulting series having the same index. Note, differs from standard left scan because initial value is not retained in result.
- U
Result type of function
- init
Initial value of scan
- f
Function taking (U, T) to U
-
def
setIndex[Y](newIx: Index[Y])(implicit arg0: ST[Y], arg1: ORD[Y]): Series[Y, T]
Create a new Series using the current values but with the new index.
Create a new Series using the current values but with the new index. Positions of the values do not change.
- Y
Type of elements of new Index
- newIx
A new Index
-
def
shift(n: Int = 1): Series[X, T]
Shift the sequence of values relative to the 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 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.
- n
Number to shift
-
def
slice(from: Int, until: Int, stride: Int = 1): Series[X, T]
Creates a view into original Series from one int offset until (exclusive) another offset.
Creates a view into original Series from one int offset until (exclusive) another offset. Data is not copied.
- from
Beginning offset
- until
Ending offset
-
def
sliceBy(rng: Slice[X]): Series[X, T]
Creates a view into original Series from one key through another key as specified in the bound argument.
Creates a view into original Series from one key through another key as specified in the bound argument. Data is not copied. Series index must be sorted.
- rng
An IRange which computes the bound locations
-
def
sliceBy(from: X, to: X, inclusive: Boolean = true): Series[X, T]
Creates a view into original Series from one key up to (inclusive by default) another key.
Creates a view into original Series from one key up to (inclusive by default) another key. Data is not copied. Series index must be sorted.
- from
Beginning offset key
- to
Ending offset key
-
def
sorted(implicit ev: ORD[T]): Series[X, T]
Create a new Series whose key/value entries are sorted according to the values of the Series.
Create a new Series whose key/value entries are sorted according to the values of the Series.
- ev
Implicit evidence of ordering for T
-
def
sortedIx: Series[X, T]
Create a new Series whose key/value entries are sorted according to the keys (index values).
-
def
splitAt(i: Int): (Series[X, T], Series[X, T])
Split Series into two series at position i
Split Series into two series at position i
- i
Position at which to split Series
-
def
splitBy(k: X): (Series[X, T], Series[X, T])
Split Series into two series at key x
Split Series into two series at key x
- k
Key at which to split Series
- def stringify(len: Int = 10): String
- def sum(implicit na: NUM[T]): T
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
tail(n: Int): Series[X, T]
Extract at most the last n elements of the Series
Extract at most the last n elements of the Series
- n
number to extract
-
def
take(locs: Array[Int]): Series[X, T]
Given int offets to take, form a new series from the keys and values found at those offsets.
Given int offets to take, form a new series from the keys and values found at those offsets.
- locs
Array of int offsets
-
def
toFrame: Frame[X, Int, T]
Converts to a single-column Frame
-
def
toSeq: IndexedSeq[(X, T)]
Convert Series to an indexed sequence of (key, value) pairs.
-
def
toString(): String
- Definition Classes
- Series → AnyRef → Any
-
def
toVec: Vec[T]
Convert Series to a Vec, by dropping the index.
-
def
unary_-(implicit num: NUM[T]): Series[X, T]
Additive inverse of Series with numeric elements
-
def
updated(value: T, keys: Array[X]): Series[X, T]
Replaces all occurences of
key
withvalue
, if presentReplaces all occurences of
key
withvalue
, if presentIf
idx
is not present then returns the same Series -
def
updated(value: T, keys: X*): Series[X, T]
Replaces all occurences of
key
withvalue
, if presentReplaces all occurences of
key
withvalue
, if presentIf
idx
is not present then returns the same Series - val values: Vec[T]
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
where(pred: Vec[Boolean]): Series[X, T]
Return Series whose keys and values are chosen via a Vec[Boolean] or a Series[_, Boolean] where the latter contains a true value.
Return Series whose keys and values are chosen via a Vec[Boolean] or a Series[_, Boolean] where the latter contains a true value.
- pred
Series[_, Boolean] (or Vec[Boolean] which will implicitly convert)
-
def
where(pred: Series[_, Boolean]): Series[X, T]
Return Series whose keys and values are chosen via a Series[_, Boolean] where the latter contains a true value.
Return Series whose keys and values are chosen via a Series[_, Boolean] where the latter contains a true value.
- pred
Series[_, Boolean] (or Vec[Boolean] which will implicitly convert)
-
def
xor[B, That](other: B)(implicit op: BinOp[XorOp, Series[X, T], B, That]): That
Logical EXCLUSIVE OR
Logical EXCLUSIVE OR
- B
type of the other operand
- That
result type of operation
- other
other operand instance
- op
implicit evidence for operation between this and other
- Definition Classes
- NumericOps
-
def
|[B, That](other: B)(implicit op: BinOp[BitOr, Series[X, T], B, That]): That
Bit-wise OR
Bit-wise OR
- B
type of the other operand
- That
result type of operation
- other
other operand instance
- op
implicit evidence for operation between this and other
- Definition Classes
- NumericOps
-
def
||[B, That](other: B)(implicit op: BinOp[OrOp, Series[X, T], B, That]): That
Logical OR
Logical OR
- B
type of the other operand
- That
result type of operation
- other
other operand instance
- op
implicit evidence for operation between this and other
- Definition Classes
- NumericOps