View Source Explorer.Backend.Series behaviour (Explorer v0.4.0)

The behaviour for series backends.

Link to this section Summary

Functions

Default inspect implementation for backends.

Create a new Series.

Link to this section Types

@type df() :: Explorer.DataFrame.t()
@type dtype() :: Explorer.Series.dtype()
@type lazy_s() :: Explorer.Series.lazy_t()
@type s() :: Explorer.Series.t()
@type t() :: struct()
@type valid_types() ::
  number() | boolean() | String.t() | Date.t() | NaiveDateTime.t()
@type window_option() ::
  {:weights, [float()] | nil}
  | {:min_periods, integer() | nil}
  | {:center, boolean()}

Link to this section Callbacks

@callback add(s() | number(), s() | number()) :: s()
@callback all_equal(s(), s()) :: boolean() | lazy_s()
Link to this callback

argsort(s, descending?, nils_last)

View Source
@callback argsort(s(), descending? :: boolean(), nils_last :: boolean()) :: s()
@callback at(s(), idx :: integer()) :: s()
@callback at_every(s(), integer()) :: s()
@callback binary_and(s(), s()) :: s()
@callback binary_or(s(), s()) :: s()
@callback bintype(s()) :: :uft8 | :binary | {:s | :u | :f, non_neg_integer()}
@callback cast(s(), dtype()) :: s()
@callback coalesce(s(), s()) :: s()
@callback concat(s(), s()) :: s()
@callback count(s()) :: number() | lazy_s()
Link to this callback

cumulative_max(s, reverse?)

View Source
@callback cumulative_max(s(), reverse? :: boolean()) :: s()
Link to this callback

cumulative_min(s, reverse?)

View Source
@callback cumulative_min(s(), reverse? :: boolean()) :: s()
Link to this callback

cumulative_sum(s, reverse?)

View Source
@callback cumulative_sum(s(), reverse? :: boolean()) :: s()
@callback distinct(s()) :: s()
@callback divide(s() | number(), s() | number()) :: s()
@callback dtype(s()) :: dtype()
@callback equal(s() | valid_types(), s() | valid_types()) :: s()
Link to this callback

fill_missing(s, strategy)

View Source
@callback fill_missing(
  s(),
  strategy :: :backward | :forward | :min | :max | :mean | valid_types()
) :: s()
@callback first(s()) :: valid_types() | lazy_s()
@callback frequencies(s()) :: df()
Link to this callback

from_binary(binary, dtype)

View Source
@callback from_binary(binary(), dtype()) :: s()
@callback from_list(list(), dtype()) :: s()
@callback greater(s() | valid_types(), s() | valid_types()) :: s()
Link to this callback

greater_equal(arg1, arg2)

View Source
@callback greater_equal(s() | valid_types(), s() | valid_types()) :: s()
@callback head(s(), n :: integer()) :: s()
@callback inspect(s(), opts :: Inspect.Opts.t()) :: Inspect.Algebra.t()
@callback is_nil(s()) :: s()
@callback is_not_nil(s()) :: s()
@callback last(s()) :: valid_types() | lazy_s()
@callback less(s() | valid_types(), s() | valid_types()) :: s()
@callback less_equal(s() | valid_types(), s() | valid_types()) :: s()
@callback mask(s(), mask :: s()) :: s()
@callback max(s()) :: number() | Date.t() | NaiveDateTime.t() | lazy_s() | nil
@callback mean(s()) :: float() | lazy_s() | nil
@callback median(s()) :: float() | lazy_s() | nil
@callback min(s()) :: number() | Date.t() | NaiveDateTime.t() | lazy_s() | nil
@callback multiply(s() | number(), s() | number()) :: s()
@callback n_distinct(s()) :: integer() | lazy_s()
@callback not s() :: s()
@callback not_equal(s() | valid_types(), s() | valid_types()) :: s()
@callback peaks(s(), :max | :min) :: s()
@callback pow(s() | number(), s() | number()) :: s()
@callback quantile(s(), float()) ::
  number() | Date.t() | NaiveDateTime.t() | lazy_s() | nil
@callback quotient(
  s() | neg_integer() | pos_integer(),
  s() | neg_integer() | pos_integer()
) :: s()
@callback remainder(
  s() | neg_integer() | pos_integer(),
  s() | neg_integer() | pos_integer()
) :: s()
@callback reverse(s()) :: s()
Link to this callback

sample(s, n_or_frac, replacement, seed)

View Source
@callback sample(s(), n_or_frac :: number(), replacement :: boolean(), seed :: integer()) ::
  s()
@callback select(predicate :: s(), s(), s()) :: s()
Link to this callback

shift(s, offset, default)

View Source
@callback shift(s(), offset :: integer(), default :: nil) :: s()
@callback size(s()) :: non_neg_integer() | lazy_s()
@callback slice(s(), indices :: list()) :: s()
Link to this callback

slice(s, offset, length)

View Source
@callback slice(s(), offset :: integer(), length :: integer()) :: s()
Link to this callback

sort(s, descending?, nils_last)

View Source
@callback sort(s(), descending? :: boolean(), nils_last :: boolean()) :: s()
@callback standard_deviation(s()) :: float() | lazy_s() | nil
@callback subtract(s() | number(), s() | number()) :: s()
@callback sum(s()) :: number() | lazy_s() | nil
@callback tail(s(), n :: integer()) :: s()
@callback to_iovec(s()) :: [binary()]
@callback to_list(s()) :: list()
@callback transform(s(), (... -> any())) :: s() | list()
@callback unordered_distinct(s()) :: s()
@callback variance(s()) :: float() | lazy_s() | nil
Link to this callback

window_max(s, window_size, list)

View Source
@callback window_max(s(), window_size :: integer(), [window_option()]) :: s()
Link to this callback

window_mean(s, window_size, list)

View Source
@callback window_mean(s(), window_size :: integer(), [window_option()]) :: s()
Link to this callback

window_min(s, window_size, list)

View Source
@callback window_min(s(), window_size :: integer(), [window_option()]) :: s()
Link to this callback

window_sum(s, window_size, list)

View Source
@callback window_sum(s(), window_size :: integer(), [window_option()]) :: s()

Link to this section Functions

Link to this function

inspect(series, backend, n_rows, inspect_opts, opts \\ [])

View Source

Default inspect implementation for backends.

Create a new Series.