Active Hackathon

Overview Of Atoti: A Python BI Analytics Tool

Atoti is a Python business intelligence analytics tool that creates a Tableau-like dashboarding interface inside Jupyter notebooks.
Atoti

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. 

THE BELAMY

Sign up for your weekly dose of what's up in emerging technology.

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]
  1. Create a session.
 import atoti as tt
 session = tt.create_session() 
  1. 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. 

  1. 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.

  1. 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. 

  1. 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",
 ) 
  1. 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()
  1. 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
Atoti Dashboard

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

More Great AIM Stories

Aditya Singh
A machine learning enthusiast with a knack for finding patterns. In my free time, I like to delve into the world of non-fiction books and video essays.

Our Upcoming Events

Conference, in-person (Bangalore)
Machine Learning Developers Summit (MLDS) 2023
19-20th Jan, 2023

Conference, in-person (Bangalore)
Rising 2023 | Women in Tech Conference
16-17th Mar, 2023

Conference, in-person (Bangalore)
Data Engineering Summit (DES) 2023
27-28th Apr, 2023

Conference, in-person (Bangalore)
MachineCon 2023
23rd Jun, 2023

3 Ways to Join our Community

Discord Server

Stay Connected with a larger ecosystem of data science and ML Professionals

Telegram Channel

Discover special offers, top stories, upcoming events, and more.

Subscribe to our newsletter

Get the latest updates from AIM