Run this notebook

Use Livebook to open this notebook and explore new ideas.

It is easy to get started, on your machine or the cloud.

Click below to open and run it in your Livebook at .

(or change your Livebook location)

<!-- livebook:{"persist_outputs":true} --> # Explorer: 02 - Getting started ```elixir Mix.install([{:explorer, "~> 0.9.2"}]) ``` ## Your first dataframe ```elixir df = Explorer.DataFrame.new( city: ["New York", "Los Angeles", "Chicago"], population: [8_419_000, 3_979_000, 2_716_000] ) ``` <!-- livebook:{"output":true} --> ``` #Explorer.DataFrame< Polars[3 x 2] city string ["New York", "Los Angeles", "Chicago"] population s64 [8419000, 3979000, 2716000] > ``` ## Using an alias In Elixir, we ususually use `alias` to create an alias for a module. For example: ``` alias Explorer.DataFrame, as: DF ``` But with Explorer, its recommended to use `require` instead, like the following: ``` require Explorer.DataFrame, as: DF ``` The reason for this is that `require` will load Explorer's macro features which allow for a friendly way to query dataframes. The macros compile regular Elixir code to a form for efficient dataframes operations. More information: * Elixir's official documentation has more information about [alias vs require](https://hexdocs.pm/elixir/alias-require-and-import.html) * [Explorer.Query](https://hexdocs.pm/explorer/Explorer.Query.html) ```elixir require Explorer.DataFrame, as: DF ``` <!-- livebook:{"output":true} --> ``` Explorer.DataFrame ``` ```elixir df = DF.new( city: ["New York", "Los Angeles", "Chicago"], population: [8_419_000, 3_979_000, 2_716_000] ) ``` <!-- livebook:{"output":true} --> ``` #Explorer.DataFrame< Polars[3 x 2] city string ["New York", "Los Angeles", "Chicago"] population s64 [8419000, 3979000, 2716000] > ```
See source

Have you already installed Livebook?

If you already installed Livebook, you can configure the default Livebook location where you want to open notebooks.
Livebook up Checking status We can't reach this Livebook (but we saved your preference anyway)
Run notebook

Not yet? Install Livebook in just a minute

Livebook is open source, free, and ready to run anywhere.

Run in the cloud

on select platforms

To run on Linux, Docker, embedded devices, or Elixir’s Mix, check our README.

PLATINUM SPONSORS
SPONSORS
Code navigation with go to definition of modules and functions Read More