Skip to content

Instantly share code, notes, and snippets.

@dkuku
Created December 8, 2023 18:35
Show Gist options
  • Save dkuku/f3a86d28a48f9226101668fe44d0ef1e to your computer and use it in GitHub Desktop.
Save dkuku/f3a86d28a48f9226101668fe44d0ef1e to your computer and use it in GitHub Desktop.

Untitled notebook

Mix.install([
  {:kino_explorer, "~> 0.1.11"},
  {:unzip, "~> 0.9.0"}
])

Section

require Explorer.DataFrame, as: DF

[customers, orders, orders_items, products] =
  for type <- [:customers, :orders, :orders_items, :products] do
    "/home/kuku/5784/noahs-#{type}.csv"
    |> DF.from_csv!()
  end
co =
  products
  |> DF.filter(contains(desc, "Rug Cleaner"))
  |> DF.join(orders_items)
  |> DF.join(orders)
  |> DF.filter(contains(ordered, "2017"))
  |> DF.join(customers)
  |> DF.filter(contains(name, "J") and contains(name, "P"))
  |> then(& &1[:phone])
  |> Explorer.Series.first()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment