Atoti is a Python business intelligence analytics tool that creates a Tableau-like dashboarding interface inside Jupyter notebooks. It provides a BI web application that enables hassle-free dashboard creation and sharing. Notebooks on their own are an amazing tool but they very obvious limitation when it comes to analytics tasks:
- Pandas DataFrames are good for data wrangling, but they start to slow down when the datasets grow larger than a couple of GigaBytes, forcing the analyst to start over in Spark.
- Visualization libraries create frozen plots, sure they are interactive, but you can’t apply filters without creating a new plot.
- Lack of native support for multi-dimensional analysis like OLAP applications.
Atoti Stores
, in-memory tables, scale very efficiently and can handle a lot more data than DataFrames. Additionally, it enables analysts to create advanced data models using joins between stores without duplicating data as done by a merge in pandas. Atoti has embedded interactive data visualization tools that can be used to build scenarios, apply filters and compare different versions of the data.
That being said, atoti doesn’t aim to replace pandas or Spark; they are both good tools for cleaning and transforming data. Atoti, on the other hand, focuses on visualization, analysis and collaboration. If that’s the case, then why not just use a dedicated BI tool like Tableau or PowerBI? For starters, atoti eliminates the need to export the data and load it into another software. In addition to that, it enables analysts to create new measures in Python rather than using a niche language like PowerBI’s DAX.
Creating a Dashboard with Atoti
Atoti can be installed from PyPI, if you want to use it interactively in notebooks, you’ll need to install its JupyterLab plugin as well.
pip install atoti[jupyterlab]
- Create a session.
import atoti as tt session = tt.create_session()
- Load the data into an atoti
Store
session.load_all_data() data = session.read_csv("FL_insurance_sample.csv", keys=["policyID"]) data.head()
load_all_data()
needs to be called when there are more than 1000 rows; otherwise, the first 1000 rows are sampled. The keys
argument is used to indicate the primary key of the table.
- Inspired by OLAP applications, the data in atoti is modelled as cubes before analysis. Cubes provide a multidimensional view of data; they make it easy to explore, aggregate, filter and compare. It’s called a cube because each attribute of the data can be thought of as a cube dimension.
cube = session.create_cube(data)
Read more about OLAP cubes here.
- The cube automatically creates hierarchies for all non-numeric fields and measures for the numeric fields. Let’s see the measures created by the cube.
m = cube.measures m
The cube has created sum and mean measures for all numeric fields.
- Using the
query()
method, you can fetch the value of measures over the whole dataset.
cube.query(m["eq_site_limit.SUM"], levels=l["county"])
Or dice the cube to get the value for each COUNTY
cube.query(m["eq_site_limit.SUM"], levels=l["county"])
Or slice on a particular COUNTY
cube.query( m["eq_site_limit.SUM"], condition=l["county"] == "BRADFORD COUNTY", )
- To create visualisations call the visualize method on the cube object. This will create a widget in the notebook and open the atoti tab on the left to manipulate the widget.
session.visualize()
- Building small widgets like this is good for exploring data but for providing deeper insights dashboard are better. Atoti enables creating dashboards by providing a web application that can be accessed outside of the notebook; here, widgets can be used to form sharable dashboards. The URL of this web app can be accessed by
session.url
This web application is a “safe” environment; all the filters and queries are read-only and the original data is not affected by it.
Last Epoch
This article introduced atoti, an analytics tool that enables analysts to analyze millions of rows on their laptops. It supports multi-dimensional analysis with OLAP cubes and the creation of interactive widgets inside Jupyter notebooks without any code. Atoti has various plugins that allow it to work with data from cloud platforms like AWS, GCP, Azure, etc. To learn more about atoti you can refer to the documentation.