Series

org.saddle.Series
See theSeries companion object
class Series[X, T](val values: Vec[T], val index: Index[X])(implicit evidence$1: ScalarTag[X], evidence$2: Order[X], evidence$3: ScalarTag[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, ...)

Type parameters

T

Type of elements in the values array, for which there must be an implicit ST

X

Type of elements in the index, for which there must be an implicit Ordering and ST

Value parameters

index

Index backing the keys in the Series

values

Vec backing the values in the Series

Attributes

Companion
object
Graph
Supertypes
trait NumericOps[Series[X, T]]
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def align[U : ScalarTag](other: Series[X, U], how: JoinType): (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

Value parameters

how

How to perform the join on the indexes

other

Other series to align with

Attributes

def apply(keys: Array[X]): Series[X, T]

Extract a Series corresponding to those keys provided. Returns a new Series whose key-value pairs maintain the original ordering.

Extract a Series corresponding to those keys provided. Returns a new Series whose key-value pairs maintain the original ordering.

Value parameters

keys

Array of keys

Attributes

def apply(keys: Vec[X]): Series[X, T]
def apply(keys: X*): Series[X, T]

Extract a Series corresponding to those keys provided. Returns a new Series whose key-value pairs maintain the original ordering.

Extract a Series corresponding to those keys provided. Returns a new Series whose key-value pairs maintain the original ordering.

Value parameters

keys

Sequence of keys

Attributes

def apply(slice: Slice[X]): Series[X, T]

Extract a Series whose keys respect the Slice provided. Returns a new Series whose key-value pairs maintain the original ordering.

Extract a Series whose keys respect the Slice provided. Returns a new Series whose key-value pairs maintain the original ordering.

Value parameters

slice

Slice

Attributes

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

Value parameters

loc

offset into Series

Attributes

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

Value parameters

locs

Array of int offsets into Series

Attributes

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

Value parameters

locs

Sequence of Int

Attributes

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. 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.

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.

Type parameters

U

type of other Series Values

V

type of resulting Series values

Value parameters

md

Implicit evidence of ST[C]

other

Series[X, B] to concat

pro

Implicit evidence of Promoter[A, B, C]

Attributes

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

Value parameters

key

The key to check

Attributes

def count: Int
def countif(test: T => Boolean): Int
def distinctIx: Series[X, T]

Return the series with the first occurence of each key

Return the series with the first occurence of each key

Attributes

def dropNA: Series[X, T]

Creates a Series having the same values but excluding all key/value pairs in which the value is NA.

Creates a Series having the same values but excluding all key/value pairs in which the value is NA.

Attributes

override def equals(other: Any): Boolean

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 type Any, x.equals(x) should return true.
  • It is symmetric: for any instances x and y of type Any, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any instances x, y, and z of type Any if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.

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)).

Value parameters

that

the object to compare against this object for equality.

Attributes

Returns

true if the receiver object is equivalent to the argument; false otherwise.

Definition Classes
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

Value parameters

pred

Predicate function from T => Boolean

Attributes

def fillBackward(limit: Int): Series[X, T]

Fill NA values by propagating defined values backward.

Fill NA values by propagating defined values backward.

Value parameters

limit

If > 0, propagate over a maximum of limit consecutive NA values.

Attributes

def fillForward(limit: Int): Series[X, T]

Fill NA values by propagating defined values forward.

Fill NA values by propagating defined values forward.

Value parameters

limit

If > 0, propagate over a maximum of limit consecutive NA values.

Attributes

def fillNA(f: X => T): Series[X, T]

Fill NA values in series with result of a function which acts on the index of the particular NA value found.

Fill NA values in series with result of a function which acts on the index of the particular NA value found.

Value parameters

f

A function X => A to be applied at NA location

Attributes

def fillNA(method: FillMethod, limit: Int): Series[X, T]

Fill NA values by propagating defined values.

Fill NA values by propagating defined values.

Value parameters

limit

If > 0, propagate over a maximum of limit consecutive NA values.

Attributes

def filter(pred: T => Boolean): Series[X, T]

Return Series whose values satisfy a predicate function

Return Series whose values satisfy a predicate function

Value parameters

pred

Predicate function from T => Boolean

Attributes

def filterAt(pred: Int => Boolean): Series[X, T]

Return Series whose offets satisfy a predicate function

Return Series whose offets satisfy a predicate function

Value parameters

pred

Predicate function from Int => Boolean

Attributes

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

Value parameters

pred

Predicate function from X => Boolean

Attributes

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.

Value parameters

pred

Function from T to Boolean

Attributes

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.

Value parameters

pred

Function from T to Boolean

Attributes

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.

Value parameters

pred

Function from T to Boolean

Attributes

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.

Value parameters

pred

Function from T to Boolean

Attributes

def first: Scalar[T]

Get the first value of the Series

Get the first value of the Series

Attributes

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

Value parameters

key

Key on which to match

Attributes

def firstKey: Scalar[X]

Get the first key of the Series

Get the first key of the Series

Attributes

def flatMap[Y : Order, U : ScalarTag](f: ((X, T)) => Iterable[(Y, U)]): Series[Y, U]

Map and then flatten over the key-value pairs of the Series, resulting in a new Series.

Map and then flatten over the key-value pairs of the Series, resulting in a new Series.

Attributes

def get(key: X): Scalar[T]

Alias for first. If a key exists, get the value associated with the first occurrence of that key.

Alias for first. If a key exists, get the value associated with the first occurrence of that key.

Attributes

def getRaw(key: X): T

If a key exists, get the value associated with the first occurrence of that key. If the key does not exists, then throw.

If a key exists, get the value associated with the first occurrence of that key. If the key does not exists, then throw.

Attributes

def groupBy: SeriesGrouper[X, X, T]

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.

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.

Attributes

def groupBy[Y : Order](fn: X => Y): SeriesGrouper[Y, X, T]

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.

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.

Type parameters

Y

Type of function codomain

Value parameters

fn

Function from X => Y

Attributes

def groupBy[Y : Order](ix: Index[Y]): SeriesGrouper[Y, X, T]

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.

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.

Type parameters

Y

Type of elements of ix

Value parameters

ix

Index with which to perform grouping

Attributes

def hasNA: Boolean

Return true if there is at least one NA value in the Series

Return true if there is at least one NA value in the Series

Attributes

override def hashCode(): Int

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
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

Value parameters

n

Number of elements to extract

Attributes

def isEmpty: Boolean

True if and only if number of elements is zero

True if and only if number of elements is zero

Attributes

def join(other: Series[X, T], how: JoinType): Frame[X, Int, T]

Perform a join with another Series[X, T] according to its index. The how argument dictates how the join is to be performed:

Perform a join with another Series[X, T] according to its index. The how argument dictates how the join is to be performed:

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.

Value parameters

how

How to perform the join

other

Series to join with

Attributes

def joinF(other: Frame[X, _, T], how: JoinType): Frame[X, Int, T]

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.

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.

Value parameters

how

How to perform the join

other

Frame[X, Any, T]

Attributes

def joinMap[U : ScalarTag, V : ScalarTag](other: Series[X, U], how: JoinType)(f: (T, U) => 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.

Type parameters

U

Type of other series values

V

The result type of the function

Value parameters

f

The function to apply

how

The type of join to effect

other

Other series

Attributes

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

Value parameters

loc

offset into Series

Attributes

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

Value parameters

locs

array of int offset into Index

Attributes

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

Value parameters

locs

Sequence of int offsets into Index

Attributes

def last: Scalar[T]

Get the last value of the Series

Get the last value of the Series

Attributes

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

Value parameters

key

Key on which to match

Attributes

def lastKey: Scalar[X]

Get the last key of the Series

Get the last key of the Series

Attributes

def length: Int

The length shared by both the index and the values array

The length shared by both the index and the values array

Attributes

def map[Y : Order, U : ScalarTag](f: ((X, T)) => (Y, U)): Series[Y, U]

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.

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.

Type parameters

U

The type of the resulting values

Y

The type of the resulting index

Value parameters

f

Function from (X,T) to (Y,U)

Attributes

def mapIndex[Y : Order](fn: X => 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

Type parameters

Y

Result type of index, ie Index[Y]

Value parameters

fn

The function X => Y with which to map

Attributes

def mapValues[U : ScalarTag](f: T => U): Series[X, U]

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.

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.

Type parameters

U

The type of the resulting values

Value parameters

f

Function from T to U

Attributes

def mapVec[Y : ScalarTag](fn: Vec[T] => Vec[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

Type parameters

Y

Result type of index, ie Index[Y]

Value parameters

fn

The function T => Y with which to map

Attributes

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

Value parameters

m

Mask Vec[Boolean]

Attributes

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

Value parameters

f

Function from T to Boolean

Attributes

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

Value parameters

f

Function from X to Boolean

Attributes

def max(implicit na: Numeric[T]): Scalar[T]
def maxKey(implicit num: Numeric[T]): Scalar[X]

Return key corresponding to maximum value in series

Return key corresponding to maximum value in series

Attributes

def median(implicit na: Numeric[T]): Double
def min(implicit na: Numeric[T]): Scalar[T]
def minKey(implicit num: Numeric[T]): Scalar[X]

Return key corresponding to minimum value in series

Return key corresponding to minimum value in series

Attributes

def pivot[O1, O2](implicit split: Splitter[X, O1, O2], ord1: Order[O1], ord2: Order[O2], m1: ScalarTag[O1], m2: ScalarTag[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

Type parameters

O1

Output row index

O2

Output col index

Value parameters

m1

Implicit evidence of a ST for O1

m2

Implicit evidence of a ST for O2

ord1

Implicit evidence of an ordering for O1

ord2

Implicit evidence of an ordering for O2

split

Implicit evidence of a Splitter for the index

Attributes

def proxyWith(proxy: Series[X, T]): Series[X, T]

Fill series NA's with values using a secondary series

Fill series NA's with values using a secondary series

Value parameters

proxy

The series containing the values to use

Attributes

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

Value parameters

loc

offset into Series

Attributes

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.

Value parameters

newIx

Index of the result series

Attributes

def reindex(keys: X*): Series[X, T]

Create a new Series whose index is formed of the provided argument, and whose values are derived from the original Series.

Create a new Series whose index is formed of the provided argument, and whose values are derived from the original Series.

Value parameters

keys

Sequence of keys to be the index of the result series

Attributes

def reindex(newIx: Index[X], fillMethod: FillMethod, limit: Int): Series[X, T]

Create a new Series whose index is newIx and whose values are derived from the original Series. For keys in newIx not contained in this series's index, the associated values are derived based on the filling method fillMethod against this series. This series must be monotonic, othrwise IllegalArgumentException is thrown.

Create a new Series whose index is newIx and whose values are derived from the original Series. For keys in newIx not contained in this series's index, the associated values are derived based on the filling method fillMethod against this series. This series must be monotonic, othrwise IllegalArgumentException is thrown.

Value parameters

fillMethod

Filling method to derive unfound keys of newId in this series. FillForward or FillBackward.

keys

Sequence of keys to be the index of the result series

limit

Limit for the filling method. Not applicable if <= 0.

Attributes

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.

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.

Attributes

def reversed: Series[X, T]

Create a new Series whose values and index keys are both in reversed order

Create a new Series whose values and index keys are both in reversed order

Attributes

def rolling[B : ScalarTag](winSz: Int, f: Series[X, T] => 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.

Type parameters

B

Result type of function

Value parameters

f

Function Series[X, T] => B to operate on sliding window

winSz

Window size

Attributes

def scanLeft[U : ScalarTag](init: U)(f: (U, T) => 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. Note, differs from standard left scan because initial value is not retained in result.

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.

Type parameters

U

Result type of function

Value parameters

f

Function taking (U, T) to U

init

Initial value of scan

Attributes

def setIndex[Y : Order](newIx: Index[Y]): Series[Y, T]

Create a new Series using the current values but with the new index. Positions of the values do not change.

Create a new Series using the current values but with the new index. Positions of the values do not change.

Type parameters

Y

Type of elements of new Index

Value parameters

newIx

A new Index

Attributes

def shift(n: Int): 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.

Value parameters

n

Number to shift

Attributes

def slice(from: Int, until: Int, stride: Int): Series[X, T]

Creates a view into original Series from one int offset until (exclusive) another offset. Data is not copied.

Creates a view into original Series from one int offset until (exclusive) another offset. Data is not copied.

Value parameters

from

Beginning offset

until

Ending offset

Attributes

def sliceBy(from: X, to: X, inclusive: Boolean): Series[X, T]

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.

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.

Value parameters

from

Beginning offset key

to

Ending offset key

Attributes

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. Data is not copied. Series index must be sorted.

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.

Value parameters

rng

An IRange which computes the bound locations

Attributes

def sorted(implicit ev: Order[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.

Value parameters

ev

Implicit evidence of ordering for T

Attributes

def sortedIx: Series[X, T]

Create a new Series whose key/value entries are sorted according to the keys (index values).

Create a new Series whose key/value entries are sorted according to the keys (index values).

Attributes

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

Value parameters

i

Position at which to split Series

Attributes

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

Value parameters

k

Key at which to split Series

Attributes

def stringify(len: Int): String
def sum(implicit na: Numeric[T]): T
def swap(implicit ord: Order[T]): Series[T, X]

Return a series with the current index as values and current values as index

Return a series with the current index as values and current values as index

Attributes

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

Value parameters

n

number to extract

Attributes

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.

Value parameters

locs

Array of int offsets

Attributes

def toFrame: Frame[X, Int, T]

Converts to a single-column Frame

Converts to a single-column Frame

Type parameters

T

Type of values Vec

X

Type of Index

Value parameters

s

Series to promote

Attributes

def toSeq: IndexedSeq[(X, T)]

Convert Series to an indexed sequence of (key, value) pairs.

Convert Series to an indexed sequence of (key, value) pairs.

Attributes

override def toString: String

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
def toVec: Vec[T]

Convert Series to a Vec, by dropping the index.

Convert Series to a Vec, by dropping the index.

Attributes

def unary_-(implicit num: Numeric[T]): Series[X, T]

Additive inverse of Series with numeric elements

Additive inverse of Series with numeric elements

Attributes

def updated(value: T, keys: X*): Series[X, T]

Replaces all occurences of key with value, if present

Replaces all occurences of key with value, if present

If idx is not present then returns the same Series

Attributes

def updated(value: T, keys: Array[X]): Series[X, T]

Replaces all occurences of key with value, if present

Replaces all occurences of key with value, if present

If idx is not present then returns the same Series

Attributes

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.

Value parameters

pred

Series[_, Boolean] (or Vec[Boolean] which will implicitly convert)

Attributes

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.

Value parameters

pred

Series[_, Boolean] (or Vec[Boolean] which will implicitly convert)

Attributes

Inherited methods

def %[B, That](other: B)(implicit op: BinOp[Mod, Series[X, T], B, That]): That

Integer modulus of division

Integer modulus of division

Type parameters

B

type of the other operand

That

result type of operation

Value parameters

op

implicit evidence for operation between this and other

other

other operand instance (divisor)

Attributes

Inherited from:
NumericOps
def %=[B](other: B)(implicit op: BinOpInPlace[Mod, Series[X, T], B]): Unit

Attributes

Inherited from:
NumericOps
def &[B, That](other: B)(implicit op: BinOp[BitAnd, Series[X, T], B, That]): That

Bit-wise AND

Bit-wise AND

Type parameters

B

type of the other operand

That

result type of operation

Value parameters

op

implicit evidence for operation between this and other

other

other operand instance

Attributes

Inherited from:
NumericOps
def &&[B, That](other: B)(implicit op: BinOp[AndOp, Series[X, T], B, That]): That

Logical AND

Logical AND

Type parameters

B

type of the other operand

That

result type of operation

Value parameters

op

implicit evidence for operation between this and other

other

other operand instance

Attributes

Inherited from:
NumericOps
def *[B, That](other: B)(implicit op: BinOp[Multiply, Series[X, T], B, That]): That

Multiplication

Multiplication

Type parameters

B

type of the other operand

That

result type of operation

Value parameters

op

implicit evidence for operation between this and other

other

other operand instance

Attributes

Inherited from:
NumericOps
def **[B, That](other: B)(implicit op: BinOp[Power, Series[X, T], B, That]): That

Exponentiation

Exponentiation

Type parameters

B

type of the other operand

That

result type of operation

Value parameters

op

implicit evidence for operation between this and other

other

other operand instance (exponent)

Attributes

Inherited from:
NumericOps
def **=[B](other: B)(implicit op: BinOpInPlace[Power, Series[X, T], B]): Unit

Attributes

Inherited from:
NumericOps
def *=[B](other: B)(implicit op: BinOpInPlace[Multiply, Series[X, T], B]): Unit

Attributes

Inherited from:
NumericOps
def +[B, That](other: B)(implicit op: BinOp[Add, Series[X, T], B, That]): That

Addition

Addition

Type parameters

B

type of the other operand

That

result type of operation

Value parameters

op

implicit evidence for operation between this and other

other

other operand instance

Attributes

Inherited from:
NumericOps
def +=[B](other: B)(implicit op: BinOpInPlace[Add, Series[X, T], B]): Unit

Attributes

Inherited from:
NumericOps
def -[B, That](other: B)(implicit op: BinOp[Subtract, Series[X, T], B, That]): That

Subtraction

Subtraction

Type parameters

B

type of the other operand

That

result type of operation

Value parameters

op

implicit evidence for operation between this and other

other

other operand instance

Attributes

Inherited from:
NumericOps
def -=[B](other: B)(implicit op: BinOpInPlace[Subtract, Series[X, T], B]): Unit

Attributes

Inherited from:
NumericOps
def /[B, That](other: B)(implicit op: BinOp[Divide, Series[X, T], B, That]): That

Division

Division

Type parameters

B

type of the other operand

That

result type of operation

Value parameters

op

implicit evidence for operation between this and other

other

other operand instance (divisor)

Attributes

Inherited from:
NumericOps
def /=[B](other: B)(implicit op: BinOpInPlace[Divide, Series[X, T], B]): Unit

Attributes

Inherited from:
NumericOps
def <[B, That](other: B)(implicit op: BinOp[LtOp, Series[X, T], B, That]): That

Less-than comparison operator

Less-than comparison operator

Type parameters

B

type of the other operand

That

result type of operation

Value parameters

op

implicit evidence for operation between this and other

other

other operand instance

Attributes

Inherited from:
NumericOps
def <<[B, That](other: B)(implicit op: BinOp[BitShl, Series[X, T], B, That]): That

Bit-shift left

Bit-shift left

Type parameters

B

type of the other operand

That

result type of operation

Value parameters

op

implicit evidence for operation between this and other

other

other operand instance

Attributes

Inherited from:
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

Type parameters

B

type of the other operand

That

result type of operation

Value parameters

op

implicit evidence for operation between this and other

other

other operand instance

Attributes

Inherited from:
NumericOps
def <>[B, That](other: B)(implicit op: BinOp[NeqOp, Series[X, T], B, That]): That

Element-wise inequality operator

Element-wise inequality operator

Type parameters

B

type of the other operand

That

result type of operation

Value parameters

op

implicit evidence for operation between this and other

other

other operand instance

Attributes

Inherited from:
NumericOps
def =?[B, That](other: B)(implicit op: BinOp[EqOp, Series[X, T], B, That]): That

Element-wise equality operator

Element-wise equality operator

Type parameters

B

type of the other operand

That

result type of operation

Value parameters

op

implicit evidence for operation between this and other

other

other operand instance

Attributes

Inherited from:
NumericOps
def >[B, That](other: B)(implicit op: BinOp[GtOp, Series[X, T], B, That]): That

Greater-than comparison operator

Greater-than comparison operator

Type parameters

B

type of the other operand

That

result type of operation

Value parameters

op

implicit evidence for operation between this and other

other

other operand instance

Attributes

Inherited from:
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

Type parameters

B

type of the other operand

That

result type of operation

Value parameters

op

implicit evidence for operation between this and other

other

other operand instance

Attributes

Inherited from:
NumericOps
def >>[B, That](other: B)(implicit op: BinOp[BitShr, Series[X, T], B, That]): That

Bit-shift right (arithmetic)

Bit-shift right (arithmetic)

Type parameters

B

type of the other operand

That

result type of operation

Value parameters

op

implicit evidence for operation between this and other

other

other operand instance

Attributes

Inherited from:
NumericOps
def >>>[B, That](other: B)(implicit op: BinOp[BitUShr, Series[X, T], B, That]): That

Bit-shift right (logical)

Bit-shift right (logical)

Type parameters

B

type of the other operand

That

result type of operation

Value parameters

op

implicit evidence for operation between this and other

other

other operand instance

Attributes

Inherited from:
NumericOps
def ^[B, That](other: B)(implicit op: BinOp[BitXor, Series[X, T], B, That]): That

Bit-wise EXCLUSIVE OR

Bit-wise EXCLUSIVE OR

Type parameters

B

type of the other operand

That

result type of operation

Value parameters

op

implicit evidence for operation between this and other

other

other operand instance

Attributes

Inherited from:
NumericOps
def dot[B, That](other: B)(implicit op: BinOp[InnerProd, Series[X, T], B, That]): That

Dot (inner) product

Dot (inner) product

Type parameters

B

type of the other operand

That

result type of operation

Value parameters

op

implicit evidence for operation between this and other

other

other operand instance

Attributes

Inherited from:
NumericOps
def outer[B, That](other: B)(implicit op: BinOp[OuterProd, Series[X, T], B, That]): That

Outer product

Outer product

Type parameters

B

type of the other operand

That

result type of operation

Value parameters

op

implicit evidence for operation between this and other

other

other operand instance

Attributes

Inherited from:
NumericOps
def xor[B, That](other: B)(implicit op: BinOp[XorOp, Series[X, T], B, That]): That

Logical EXCLUSIVE OR

Logical EXCLUSIVE OR

Type parameters

B

type of the other operand

That

result type of operation

Value parameters

op

implicit evidence for operation between this and other

other

other operand instance

Attributes

Inherited from:
NumericOps
def |[B, That](other: B)(implicit op: BinOp[BitOr, Series[X, T], B, That]): That

Bit-wise OR

Bit-wise OR

Type parameters

B

type of the other operand

That

result type of operation

Value parameters

op

implicit evidence for operation between this and other

other

other operand instance

Attributes

Inherited from:
NumericOps
def ||[B, That](other: B)(implicit op: BinOp[OrOp, Series[X, T], B, That]): That

Logical OR

Logical OR

Type parameters

B

type of the other operand

That

result type of operation

Value parameters

op

implicit evidence for operation between this and other

other

other operand instance

Attributes

Inherited from:
NumericOps

Concrete fields

val index: Index[X]
val values: Vec[T]