Packages

  • package root
    Definition Classes
    root
  • package org
    Definition Classes
    root
  • package saddle

    Saddle is a Scala Data Library.

    Saddle

    Saddle is a Scala Data Library.

    Saddle provides array-backed, indexed one- and two-dimensional data structures.

    These data structures are specialized on JVM primitives. With them one can often avoid the overhead of boxing and unboxing.

    Basic operations also aim to be robust to missing values (NA's)

    The building blocks are intended to be easily composed.

    The foundational building blocks are:

    Inspiration for Saddle comes from many sources, including the R programming language, the pandas data analysis library for Python, and the Scala collections library.

    Definition Classes
    org
  • package array

    This package contains utilities for working with arrays that are specialized for numeric types.

    This package contains utilities for working with arrays that are specialized for numeric types.

    Definition Classes
    saddle
  • package binary

    Binary serialization for Frame[String,String,T] or Mat[T] with primitive T

    Binary serialization for Frame[String,String,T] or Mat[T] with primitive T

    The layout of binary format is as follows:

    • The first 6 bytes are "SADDLE"
    • The next unsigned byte is the major version
    • The next unsigned byte is the minor version
    • The next 4 bytes form a little endian integer as HEADER_LENGTH
    • The next HEADER_LENGTH bytes form an UTF-8 string as the header.
    • The header is a valid JSON object with the following fields:
      • v: numeric positive integer is the version of the header structure
      • colix : a JSON array of strings, it is the column index of the frame
      • rowix : a JSON array of strings, it is the row index of the frame
      • numrows: numeric positive integer, number of rows
      • numcols: numeric positive integer, number of cols
      • Either one of rowix or numrows may be missing
      • Either one of colix or numcols may be missing
      • rowmajor : a boolean, indicating whether the data is stored in row-major or col-major order
      • datatype : string, either "double", "long", "int", "float", "byte"
    • The header is padded with spaces (0x20) such that HEADER_LENGTH+12 is divisible by 16. The count of spaces are included in HEADER_LENGTH.
    • The next width * numRows * numCols bytes form a little endian primitive array in row-major or col-major order. numRows and numCols are determined from the rowix/numrows and colix/numcols header fields. width is determined from the datatype field (8 for double and long, 4 for int and float, 1 for byte)
    Definition Classes
    saddle
  • package csv
    Definition Classes
    saddle
  • package groupby
    Definition Classes
    saddle
  • package index
    Definition Classes
    saddle
  • package io
    Definition Classes
    saddle
  • package linalg
    Definition Classes
    saddle
  • package macros
    Definition Classes
    saddle
  • package mat
    Definition Classes
    saddle
  • package npy
    Definition Classes
    saddle
  • package ops

    Provides type aliases for a few basic operations

    Provides type aliases for a few basic operations

    Definition Classes
    saddle
  • package scalar
    Definition Classes
    saddle
  • package spire
    Definition Classes
    saddle
  • package util

    Additional utilities that need a home

    Additional utilities that need a home

    Definition Classes
    saddle
  • package vec

    Factory methods to generate Vec instances

    Factory methods to generate Vec instances

    Definition Classes
    saddle
  • ArrToVec
  • Buffer
  • FillBackward
  • FillForward
  • FillMethod
  • Frame
  • Index
  • Mat
  • Numeric
  • OptionToScalar
  • PctMethod
  • PrimitiveToScalar
  • RankTie
  • SeqToFrame
  • SeqToFrame2
  • SeqToIndex
  • SeqToMat
  • SeqToSeries
  • SeqToVec
  • Series
  • Vec
  • VecDoubleOps
  • doubleIsNumeric
  • floatIsNumeric
  • intIsNumeric
  • longIsNumeric
  • order

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

Linear Supertypes
NumericOps[Series[X, T]], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Series
  2. NumericOps
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new Series(values: Vec[T], index: Index[X])(implicit arg0: ST[X], arg1: ORD[X], arg2: ST[T])

    values

    Vec backing the values in the Series

    index

    Index backing the keys in the Series

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. 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
  4. def %=[B](other: B)(implicit op: BinOpInPlace[Mod, Series[X, T], B]): Unit
    Definition Classes
    NumericOps
  5. 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
  6. 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
  7. 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
  8. 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
  9. def **=[B](other: B)(implicit op: BinOpInPlace[Power, Series[X, T], B]): Unit
    Definition Classes
    NumericOps
  10. def *=[B](other: B)(implicit op: BinOpInPlace[Multiply, Series[X, T], B]): Unit
    Definition Classes
    NumericOps
  11. 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
  12. def +=[B](other: B)(implicit op: BinOpInPlace[Add, Series[X, T], B]): Unit
    Definition Classes
    NumericOps
  13. 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
  14. def -=[B](other: B)(implicit op: BinOpInPlace[Subtract, Series[X, T], B]): Unit
    Definition Classes
    NumericOps
  15. 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
  16. def /=[B](other: B)(implicit op: BinOpInPlace[Divide, Series[X, T], B]): Unit
    Definition Classes
    NumericOps
  17. 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
  18. 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
  19. 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
  20. 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
  21. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  22. 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
  23. 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
  24. 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
  25. 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
  26. 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
  27. 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
  28. 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

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

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

  31. def apply(keys: Vec[X]): Series[X, T]
  32. 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

  33. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  34. 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

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

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

  37. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  38. 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

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

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

    Return the series with the first occurence of each key

  43. 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
  44. def dropNA: Series[X, T]

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

  45. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  46. def equals(other: Any): Boolean
    Definition Classes
    Series → AnyRef → Any
  47. 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

  48. def fillBackward(limit: Int = 0): Series[X, T]

    Fill NA values by propagating defined values backward.

    Fill NA values by propagating defined values backward.

    limit

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

  49. def fillForward(limit: Int = 0): Series[X, T]

    Fill NA values by propagating defined values forward.

    Fill NA values by propagating defined values forward.

    limit

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

  50. def fillNA(method: FillMethod, limit: Int = 0): Series[X, T]

    Fill NA values by propagating defined values.

    Fill NA values by propagating defined values.

    limit

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

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

    f

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

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

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

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

  55. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  56. 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

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

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

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

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

  61. def first: Scalar[T]

    Get the first value of the Series

  62. def firstKey: Scalar[X]

    Get the first key of the Series

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

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

    Alias for first.

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

  65. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  66. def getRaw(key: X): T

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

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

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

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

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

  70. def hasNA: Boolean

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

  71. def hashCode(): Int
    Definition Classes
    Series → AnyRef → Any
  72. 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

  73. val index: Index[X]
  74. def isEmpty: Boolean

    True if and only if number of elements is zero

  75. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  76. 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:

    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

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

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

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

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

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

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

  83. def last: Scalar[T]

    Get the last value of the Series

  84. def lastKey: Scalar[X]

    Get the last key of the Series

  85. def length: Int

    The length shared by both the index and the values array

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

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

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

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

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

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

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

  93. def max(implicit na: NUM[T]): Scalar[T]
  94. def maxKey(implicit num: NUM[T]): Scalar[X]

    Return key corresponding to maximum value in series

  95. def median(implicit na: NUM[T]): Double
  96. def min(implicit na: NUM[T]): Scalar[T]
  97. def minKey(implicit num: NUM[T]): Scalar[X]

    Return key corresponding to minimum value in series

  98. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  99. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  100. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  101. 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
  102. 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

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

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

    proxy

    The series containing the values to use

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

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

    Create a new Series whose index is newIx and whose values are derived from the original Series.

    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.

    fillMethod

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

    limit

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

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

    keys

    Sequence of keys to be the index of the result series

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

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

  110. def reversed: Series[X, T]

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

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

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

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

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

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

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

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

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

  119. def sortedIx: Series[X, T]

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

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

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

  122. def stringify(len: Int = 10): String
  123. def sum(implicit na: NUM[T]): T
  124. def swap(implicit ord: ORD[T]): Series[T, X]

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

  125. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  126. 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

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

  128. def toFrame: Frame[X, Int, T]

    Converts to a single-column Frame

  129. def toSeq: IndexedSeq[(X, T)]

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

  130. def toString(): String
    Definition Classes
    Series → AnyRef → Any
  131. def toVec: Vec[T]

    Convert Series to a Vec, by dropping the index.

  132. def unary_-(implicit num: NUM[T]): Series[X, T]

    Additive inverse of Series with numeric elements

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

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

  135. val values: Vec[T]
  136. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  137. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  138. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  139. 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)

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

  141. 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
  142. 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
  143. 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

Inherited from NumericOps[Series[X, T]]

Inherited from AnyRef

Inherited from Any

Ungrouped