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

The behaviour for series backends.

Link to this section Summary

Callbacks

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 option(type) :: type | nil
@type s() :: Explorer.Series.t()
@type t() :: struct()
@type valid_types() ::
  number() | boolean() | String.t() | Date.t() | Time.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_in(s(), s()) :: s()
@callback binary_or(s(), s()) :: s()
@callback cast(s(), dtype()) :: s()
@callback categories(s()) :: s()
@callback categorise(s(), s()) :: s()
@callback ceil(s()) :: s()
@callback coalesce(s(), s()) :: s()
@callback concat([s()]) :: s()
@callback contains(s(), String.t()) :: 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 day_of_week(s()) :: s()
@callback distinct(s()) :: s()
@callback divide(s() | number(), s() | number()) :: s()
@callback downcase(s()) :: s()
@callback dtype(s()) :: dtype()
@callback equal(s() | valid_types(), s() | valid_types()) :: s()
Link to this callback

fill_missing_with_strategy(s, arg2)

View Source
@callback fill_missing_with_strategy(s(), :backward | :forward | :min | :max | :mean) ::
  s()
Link to this callback

fill_missing_with_value(s, arg2)

View Source
@callback fill_missing_with_value(s(), :nan | valid_types()) :: s()
@callback first(s()) :: valid_types() | lazy_s()
@callback floor(s()) :: s()
@callback format([s()]) :: 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 iotype(s()) :: :uft8 | :binary | {:s | :u | :f, non_neg_integer()}
@callback is_finite(s()) :: s()
@callback is_infinite(s()) :: s()
@callback is_nan(s()) :: s()
@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 nil_count(s()) :: number() | lazy_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()
@callback round(s(), decimals :: non_neg_integer()) :: s()
Link to this callback

sample(s, n_or_frac, replacement, shuffle, seed)

View Source
@callback sample(
  s(),
  n_or_frac :: number(),
  replacement :: boolean(),
  shuffle :: boolean(),
  seed :: option(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_date(s()) :: s()
@callback to_iovec(s()) :: [binary()]
@callback to_list(s()) :: list()
@callback to_time(s()) :: s()
@callback transform(s(), (... -> any())) :: s()
@callback trim(s()) :: s()
@callback trim_leading(s()) :: s()
@callback trim_trailing(s()) :: s()
@callback unary_not(s()) :: s()
@callback unordered_distinct(s()) :: s()
@callback upcase(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.