Building a Tableau-Like BI Application with Atoti in Jupyter Notebook
Are you tired of relying on others to explore your model's data or struggling with complex code to visualize your results? With Atoti, a powerful Python module, you can quickly create your interactive BI application in your Jupyter Notebook!
Let's explore how Atoti empowers you to analyze and visualize your data effortlessly.
Step 1: Install Atoti
Start by installing Atoti using pip:
bash
Copy code
pip install atoti
Step 2: Import Libraries and Load Data
Import the required libraries and load your model's data into a Pandas DataFrame.
python
Copy code
import pandas as pd import atoti as tt # Load your data into a Pandas DataFrame data = pd.read_csv('your_data.csv')
Step 3: Create Atoti Cube and Dashboard
Now, create an Atoti Cube using the loaded data and define the measures and dimensions for analysis.
python
Copy code
# Create an Atoti session session = tt.create_session() # Create an Atoti Cube cube = session.create_cube(data, name='MyCube') # Define dimensions and hierarchies cube.create_dimension('Dimension1', hierarchies=['Attribute1', 'Attribute2']) cube.create_dimension('Dimension2', hierarchies=['Attribute3', 'Attribute4']) # Define measures for analysis (e.g., sum, count, average) cube.create_measures('Measure1', tt.agg.sum('Column1')) cube.create_measures('Measure2', tt.agg.average('Column2'))
Step 4: Build Interactive Dashboards
Atoti allows you to build interactive dashboards easily using simple Python code.
python
Copy code
# Create a dashboard dashboard = session.create_dashboard() # Add charts and visualizations to the dashboard chart1 = dashboard.add_chart(tt.visualization.BarChart, title="Bar Chart") chart1.data = cube.query('SELECT [Dimension1].[Attribute1], [Measures].[Measure1]') chart2 = dashboard.add_chart(tt.visualization.LineChart, title="Line Chart") chart2.data = cube.query('SELECT [Dimension2].[Attribute3], [Measures].[Measure2]')
Step 5: Analyze and Play Around
Congratulations! Your Atoti-based BI application is ready. Run the notebook, and you'll see the interactive dashboard within your Jupyter environment.
Atoti's intuitive UI allows you to explore and play around with the data effortlessly. Use filters, slicers, and drill-downs to analyze your model's results from different perspectives, all without the need to write complex code or depend on a standalone BI solution.
Step 6: Share and Collaborate
The best part is that you can easily share your Jupyter Notebook with colleagues, allowing them to interact with the BI application and explore the data produced by your model collaboratively.
So, #unlockthepower of #Atoti and take control of your data analysis journey with interactive visualizations, all within your Jupyter Notebook!
(Note: Replace 'your_data.csv' with your dataset's path.)
Head of Developer Relations ?????? Product and people obsessed
1 年Wow! Thanks for the write up! I noticed a snafu or two in the code here. Not to worry: we can fix it *and* streamline it a bit. import atoti as tt session = tt.Session() data = tt.read_csv('path/to/your_data.csv') # leveraging atoti's read_csv() cube = session.create_cube(data, name='MyCube') session.link() # see the dashboarding webapp link And done! By using the default cube creation mode, Atoti will automagically create hierarchies, levels and measures based on the underlying data types. You can add widgets to your dashboard using an intuitive GUI experience. Your followers can learn more about Atoti at atoti.io or explore the documentation at docs.atoti.io