ExploringExplorer
Mix.install([
{:explorer, "~> 0.10.1"},
{:kino_explorer, "~> 0.1.24"},
{:req, "~> 0.5.14"},
{:tucan, "~> 0.5.0"},
{:kino_vega_lite, "~> 0.1.13"},
{:kino_db, "~> 0.3.0"},
{:exqlite, "~> 0.23.0"}
])
Section
This notebook is for learning purposes. Using Elixir Explorer library and the famous titanic dataset to get familiar with things.
require Explorer.DataFrame, as: DF
alias VegaLite, as: Vl
# Load the data
df = DF.from_csv!("/home/andresh/elixir/live/data/train.csv")
# Question one, how many people survived?
output =
df
|> DF.lazy()
|> DF.group_by(["Sex", "Survived"])
|> DF.summarise(PassengerId_count: count(col("PassengerId")))
|> DF.sort_by(asc: col("Sex"))
output |> DF.rename( %{"PassengerId_count" => "count"} ) |> DF.collect()
bar = Tucan.bar(output, "Survived", "PassengerId_count", color_by: "Sex")
bar |> Tucan.set_size(500,500)
bar
Tucan.scatter(df, "Age", "Fare", color_by: "Sex" , shape_by: "Embarked")
|> Tucan.set_size(500,500)