Packages

Flexible and powerful data analysis / manipulation library for Elixir, inspired by Pandas.

Current section

Files

Jump to
flask lib flask.ex
Raw

lib/flask.ex

defmodule Flask do
@moduledoc """
Functions to create and modify a dataframe, a structure with 2D table of information.
"""
defmacro __using__(_opts) do
quote do
alias Flask.{Data, DataFrame, Series}
end
end
# @doc """
# Selection
# """
# def at(%DataFrame{} = dataframe, row_label, col_label) do
# row = dataframe.index |> get_label_idx(row_label)
# col = dataframe.columns |> get_label_idx(col_label)
# dataframe.values |> Map.fetch!({row, col})
# end
# def iat(%DataFrame{} = dataframe, row, col) when is_integer(row) and is_integer(col) do
# dataframe.values |> Map.fetch!({row, col})
# end
# def iloc(%DataFrame{} = df, %Range{} = rows, %Range{} = cols) do
# with true <- valid_range?(df.rows, rows),
# true <- valid_range?(df.columns, cols) do
# index = df.index |> Enum.slice(normalize_range(rows))
# columns = df.columns |> Enum.slice(normalize_range(cols))
# df.values
# |> Map.take(for i <- rows, j <- cols, do: {i, j})
# |> DataFrame.new(index, columns)
# else
# false -> raise "Invalid ranges supplied for iloc function"
# end
# end
# def iloc(%DataFrame{} = df, row, col) when is_integer(row) and is_integer(col) do
# with true <- valid_range?(df.rows, row),
# true <- valid_range?(df.columns, col) do
# df.values
# |> Map.take([{row, col}])
# |> DataFrame.new([Enum.at(df.index, row)], [Enum.at(df.columns, col)])
# else
# false -> raise "Invalid indices supplied for iloc function"
# end
# end
@doc """
Exploring
"""
def head do
end
def tail do
end
def describe do
end
@doc """
Manipulation
"""
def merge do
end
def concat do
end
def append do
end
def transpose do
end
@doc """
Function Application, Groupby
"""
def groupby do
end
@doc """
Computation
"""
def mean do
end
def sum do
end
def avg do
end
def max do
end
def min do
end
def count do
end
end