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

The behaviour for series backends.

Summary

Callbacks

Functions

Default inspect implementation for backends.

Create a new Series.

Types

df()

@type df() :: Explorer.DataFrame.t()

dtype()

@type dtype() :: Explorer.Series.dtype()

io_result(t)

@type io_result(t) :: {:ok, t} | {:error, Exception.t()}

lazy_s()

@type lazy_s() :: Explorer.Series.lazy_t()

non_finite()

@type non_finite() :: Explorer.Series.non_finite()

option(type)

@type option(type) :: type | nil

s()

@type s() :: Explorer.Series.t()

t()

@type t() :: struct()

valid_types()

@type valid_types() ::
  number()
  | boolean()
  | String.t()
  | Date.t()
  | Time.t()
  | NaiveDateTime.t()
  | Explorer.Duration.t()
  | Decimal.t()

Callbacks

abs(s)

@callback abs(s()) :: s()

acos(s)

@callback acos(s()) :: s()

add(out_dtype, s, s)

@callback add(out_dtype :: dtype(), s(), s()) :: s()

all?(s)

@callback all?(s()) :: boolean() | lazy_s()

all_equal(s, s)

@callback all_equal(s(), s()) :: boolean() | lazy_s()

any?(s)

@callback any?(s()) :: boolean() | lazy_s()

argmax(s)

@callback argmax(s()) :: number() | non_finite() | lazy_s() | nil

argmin(s)

@callback argmin(s()) :: number() | non_finite() | lazy_s() | nil

argsort(s, descending?, maintain_order?, multithreaded?, nulls_last?)

@callback argsort(
  s(),
  descending? :: boolean(),
  maintain_order? :: boolean(),
  multithreaded? :: boolean(),
  nulls_last? :: boolean()
) :: s()

asin(s)

@callback asin(s()) :: s()

at(s, idx)

@callback at(s(), idx :: integer()) :: s()

at_every(s, integer)

@callback at_every(s(), integer()) :: s()

atan(s)

@callback atan(s()) :: s()

binary_and(s, s)

@callback binary_and(s(), s()) :: s()

binary_in(s, s)

@callback binary_in(s(), s()) :: s()

binary_or(s, s)

@callback binary_or(s(), s()) :: s()

cast(s, dtype)

@callback cast(s(), dtype()) :: s()

categories(s)

@callback categories(s()) :: s()

categorise(s, s)

@callback categorise(s(), s()) :: s()

ceil(s)

@callback ceil(s()) :: s()

clip(s, number, number)

@callback clip(s(), number(), number()) :: s()

coalesce(s, s)

@callback coalesce(s(), s()) :: s()

concat(list)

@callback concat([s()]) :: s()

contains(s, t)

@callback contains(s(), String.t()) :: s()

correlation(s, s, ddof, method)

@callback correlation(s(), s(), ddof :: non_neg_integer(), method :: atom()) ::
  float() | non_finite() | lazy_s() | nil

cos(s)

@callback cos(s()) :: s()

count(s)

@callback count(s()) :: number() | lazy_s()

count_matches(s, t)

@callback count_matches(s(), String.t()) :: s()

covariance(s, s, ddof)

@callback covariance(s(), s(), ddof :: non_neg_integer()) ::
  float() | non_finite() | lazy_s() | nil

cumulative_max(s, reverse?)

@callback cumulative_max(s(), reverse? :: boolean()) :: s()

cumulative_min(s, reverse?)

@callback cumulative_min(s(), reverse? :: boolean()) :: s()

cumulative_product(s, reverse?)

@callback cumulative_product(s(), reverse? :: boolean()) :: s()

cumulative_sum(s, reverse?)

@callback cumulative_sum(s(), reverse? :: boolean()) :: s()

cut(s, bins, labels, break_point_label, category_label, left_close, include_breaks)

@callback cut(
  s(),
  bins :: [float()],
  labels :: option([String.t()]),
  break_point_label :: option(String.t()),
  category_label :: option(String.t()),
  left_close :: boolean(),
  include_breaks :: boolean()
) :: df()

day_of_week(s)

@callback day_of_week(s()) :: s()

day_of_year(s)

@callback day_of_year(s()) :: s()

distinct(s)

@callback distinct(s()) :: s()

divide(out_dtype, s, s)

@callback divide(out_dtype :: dtype(), s(), s()) :: s()

downcase(s)

@callback downcase(s()) :: s()

equal(s, s)

@callback equal(s(), s()) :: s()

ewm_mean(s, alpha, adjust, min_periods, ignore_nils)

@callback ewm_mean(
  s(),
  alpha :: float(),
  adjust :: boolean(),
  min_periods :: integer(),
  ignore_nils :: boolean()
) :: s()

ewm_standard_deviation(s, alpha, adjust, bias, min_periods, ignore_nils)

@callback ewm_standard_deviation(
  s(),
  alpha :: float(),
  adjust :: boolean(),
  bias :: boolean(),
  min_periods :: integer(),
  ignore_nils :: boolean()
) :: s()

ewm_variance(s, alpha, adjust, bias, min_periods, ignore_nils)

@callback ewm_variance(
  s(),
  alpha :: float(),
  adjust :: boolean(),
  bias :: boolean(),
  min_periods :: integer(),
  ignore_nils :: boolean()
) :: s()

exp(s)

@callback exp(s()) :: s()

field(s, t)

@callback field(s(), String.t()) :: s()

fill_missing_with_strategy(s, arg2)

@callback fill_missing_with_strategy(s(), :backward | :forward | :min | :max | :mean) ::
  s()

fill_missing_with_value(s, arg2)

@callback fill_missing_with_value(s(), :nan | valid_types()) :: s()

first(s)

@callback first(s()) :: valid_types() | lazy_s()

floor(s)

@callback floor(s()) :: s()

format(list)

@callback format([s()]) :: s()

frequencies(s)

@callback frequencies(s()) :: df()

from_binary(binary, dtype)

@callback from_binary(binary(), dtype()) :: s()

from_list(list, dtype)

@callback from_list(list(), dtype()) :: s()

greater(s, s)

@callback greater(s(), s()) :: s()

greater_equal(s, s)

@callback greater_equal(s(), s()) :: s()

head(s, n)

@callback head(s(), n :: integer()) :: s()

hour(s)

@callback hour(s()) :: s()

inspect(s, opts)

@callback inspect(s(), opts :: Inspect.Opts.t()) :: Inspect.Algebra.t()

is_finite(s)

@callback is_finite(s()) :: s()

is_infinite(s)

@callback is_infinite(s()) :: s()

is_nan(s)

@callback is_nan(s()) :: s()

is_nil(s)

@callback is_nil(s()) :: s()

is_not_nil(s)

@callback is_not_nil(s()) :: s()

join(s, t)

@callback join(s(), String.t()) :: s()

json_decode(s, dtype)

@callback json_decode(s(), dtype()) :: s()

json_path_match(s, t)

@callback json_path_match(s(), String.t()) :: s()

last(s)

@callback last(s()) :: valid_types() | lazy_s()

lengths(s)

@callback lengths(s()) :: s()

less(s, s)

@callback less(s(), s()) :: s()

less_equal(s, s)

@callback less_equal(s(), s()) :: s()

log(argument)

@callback log(argument :: s()) :: s()

log(argument, base)

@callback log(argument :: s(), base :: float()) :: s()

lstrip(s, arg2)

@callback lstrip(s(), String.t() | nil) :: s()

mask(s, mask)

@callback mask(s(), mask :: s()) :: s()

max(s)

@callback max(s()) ::
  number() | non_finite() | Date.t() | NaiveDateTime.t() | lazy_s() | nil

mean(s)

@callback mean(s()) :: float() | non_finite() | lazy_s() | nil

median(s)

@callback median(s()) :: float() | non_finite() | lazy_s() | nil

member?(s, valid_types)

@callback member?(s(), valid_types()) :: s()

min(s)

@callback min(s()) ::
  number() | non_finite() | Date.t() | NaiveDateTime.t() | lazy_s() | nil

minute(s)

@callback minute(s()) :: s()

mode(s)

@callback mode(s()) :: s() | lazy_s()

month(s)

@callback month(s()) :: s()

multiply(out_dtype, s, s)

@callback multiply(out_dtype :: dtype(), s(), s()) :: s()

n_distinct(s)

@callback n_distinct(s()) :: integer() | lazy_s()

nil_count(s)

@callback nil_count(s()) :: number() | lazy_s()

not_equal(s, s)

@callback not_equal(s(), s()) :: s()

owner_export(s)

@callback owner_export(s()) :: io_result(term())

owner_import(term)

@callback owner_import(term()) :: io_result(s())

owner_reference(s)

@callback owner_reference(s()) :: reference() | nil

peaks(s, arg2)

@callback peaks(s(), :max | :min) :: s()

pow(out_dtype, s, s)

@callback pow(out_dtype :: dtype(), s(), s()) :: s()

product(s)

@callback product(s()) :: float() | non_finite() | lazy_s() | nil

qcut( s, quantiles, labels, break_point_label, category_label, allow_duplicates, left_close, include_breaks )

@callback qcut(
  s(),
  quantiles :: [float()],
  labels :: option([String.t()]),
  break_point_label :: option(String.t()),
  category_label :: option(String.t()),
  allow_duplicates :: boolean(),
  left_close :: boolean(),
  include_breaks :: boolean()
) :: df()

quantile(s, float)

@callback quantile(s(), float()) ::
  number() | non_finite() | Date.t() | NaiveDateTime.t() | lazy_s() | nil

quotient(s, s)

@callback quotient(s(), s()) :: s()

rank(s, method, descending, seed)

@callback rank(
  s(),
  method :: atom(),
  descending :: boolean(),
  seed :: option(integer())
) :: s() | lazy_s()

re_contains(s, t)

@callback re_contains(s(), String.t()) :: s()

re_count_matches(s, t)

@callback re_count_matches(s(), String.t()) :: s()

re_named_captures(s, t)

@callback re_named_captures(s(), String.t()) :: s()

re_replace(s, t, t)

@callback re_replace(s(), String.t(), String.t()) :: s()

re_scan(s, t)

@callback re_scan(s(), String.t()) :: s()

remainder(s, s)

@callback remainder(s(), s()) :: s()

replace(s, t, t)

@callback replace(s(), String.t(), String.t()) :: s()

reverse(s)

@callback reverse(s()) :: s()

round(s, decimals)

@callback round(s(), decimals :: non_neg_integer()) :: s()

row_index(s)

@callback row_index(s()) :: s() | lazy_s()

rstrip(s, arg2)

@callback rstrip(s(), String.t() | nil) :: s()

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

@callback sample(
  s(),
  n_or_frac :: number(),
  replacement :: boolean(),
  shuffle :: boolean(),
  seed :: option(integer())
) :: s()

second(s)

@callback second(s()) :: s()

select(predicate, s, s)

@callback select(predicate :: s(), s(), s()) :: s()

shift(s, offset, default)

@callback shift(s(), offset :: integer(), default :: nil) :: s()

sin(s)

@callback sin(s()) :: s()

size(s)

@callback size(s()) :: non_neg_integer() | lazy_s()

skew(s, bias?)

@callback skew(s(), bias? :: boolean()) :: float() | non_finite() | lazy_s() | nil

slice(s, indices)

@callback slice(s(), indices :: list() | s()) :: s()

slice(s, offset, length)

@callback slice(s(), offset :: integer(), length :: integer()) :: s()

sort(s, descending?, maintain_order?, multithreaded?, nulls_last?)

@callback sort(
  s(),
  descending? :: boolean(),
  maintain_order? :: boolean(),
  multithreaded? :: boolean(),
  nulls_last? :: boolean()
) :: s()

split(s, t)

@callback split(s(), String.t()) :: s()

split_into(s, t, list)

@callback split_into(s(), String.t(), [String.t() | atom()]) :: s()

standard_deviation(s, ddof)

@callback standard_deviation(s(), ddof :: non_neg_integer()) ::
  float() | non_finite() | lazy_s() | nil

strftime(s, t)

@callback strftime(s(), String.t()) :: s()

strip(s, arg2)

@callback strip(s(), String.t() | nil) :: s()

strptime(s, t)

@callback strptime(s(), String.t()) :: s()

substring(s, integer, arg3)

@callback substring(s(), integer(), non_neg_integer() | nil) :: s()

subtract(out_dtype, s, s)

@callback subtract(out_dtype :: dtype(), s(), s()) :: s()

sum(s)

@callback sum(s()) :: number() | non_finite() | lazy_s() | nil

tail(s, n)

@callback tail(s(), n :: integer()) :: s()

tan(s)

@callback tan(s()) :: s()

to_iovec(s)

@callback to_iovec(s()) :: [binary()]

to_list(s)

@callback to_list(s()) :: list()

transform(s, function)

@callback transform(s(), (... -> any())) :: s()

unary_not(s)

@callback unary_not(s()) :: s()

unordered_distinct(s)

@callback unordered_distinct(s()) :: s()

upcase(s)

@callback upcase(s()) :: s()

variance(s, ddof)

@callback variance(s(), ddof :: non_neg_integer()) ::
  float() | non_finite() | lazy_s() | nil

week_of_year(s)

@callback week_of_year(s()) :: s()

window_max(s, window_size, weights, min_periods, center)

@callback window_max(
  s(),
  window_size :: integer(),
  weights :: [float()] | nil,
  min_periods :: integer() | nil,
  center :: boolean()
) :: s()

window_mean(s, window_size, weights, min_periods, center)

@callback window_mean(
  s(),
  window_size :: integer(),
  weights :: [float()] | nil,
  min_periods :: integer() | nil,
  center :: boolean()
) :: s()

window_median(s, window_size, weights, min_periods, center)

@callback window_median(
  s(),
  window_size :: integer(),
  weights :: [float()] | nil,
  min_periods :: integer() | nil,
  center :: boolean()
) :: s()

window_min(s, window_size, weights, min_periods, center)

@callback window_min(
  s(),
  window_size :: integer(),
  weights :: [float()] | nil,
  min_periods :: integer() | nil,
  center :: boolean()
) :: s()

window_standard_deviation(s, window_size, weights, min_periods, center)

@callback window_standard_deviation(
  s(),
  window_size :: integer(),
  weights :: [float()] | nil,
  min_periods :: integer() | nil,
  center :: boolean()
) :: s()

window_sum(s, window_size, weights, min_periods, center)

@callback window_sum(
  s(),
  window_size :: integer(),
  weights :: [float()] | nil,
  min_periods :: integer() | nil,
  center :: boolean()
) :: s()

year(s)

@callback year(s()) :: s()

Functions

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

Default inspect implementation for backends.

new(data, dtype)

Create a new Series.