Creating Interactive Analytics Dashboards Using Python’s Streamlit

<p>Imagine you&rsquo;re a Data Scientist, Analyst, Machine Learning Engineer, or a Web Developer, and you want to transform your Python data script into a quick actionable insight. Streamlit is your answer.<br /> <strong>Streamlit&nbsp;</strong>is an open-source Python framework that allows you to effortlessly create web applications. With Streamlit, you can turn your data scripts into shareable web apps in minutes, not weeks, and it&rsquo;s absolutely free to use.</p> <p>In this article, you will learn how to build an analytics dashboard using the Streamlit Python package. We will guide you through the process step by step, from installing the necessary packages to creating interactive visualizations.</p> <h1>Python Packages</h1> <p>Before we get started, you&rsquo;ll need to install the following packages using pip:</p> <pre> pip install streamlit numpy pandas streamlit_extras millify altair plotly</pre> <p>After installing the required packages, import them into your python script.</p> <pre> import streamlit as st # streamlit package import numpy as np import pandas as pd from millify import millify # shortens values (10_000 ---&gt; 10k) from streamlit_extras.metric_cards import style_metric_cards # beautify metric card with css import plotly.graph_objects as go import altair as alt </pre> <h1>Load the dataset</h1> <p>For this tutorial, we&rsquo;ll use the Superstore Sales dataset available on&nbsp;<a href="https://data.world/ehughes/superstore-sales-2023" rel="noopener ugc nofollow" target="_blank">Superstore Sales 2023 &mdash; dataset by ehughes | data.world</a>.</p> <p><img alt="" src="https://miro.medium.com/v2/resize:fit:630/1*IoX-u7hZ-jC9NC7-D6I-0g.png" style="height:192px; width:700px" /></p> <p>preview of the Superstore Sales dataset.</p> <p>Before building a dashboard with your data, it&rsquo;s essential to define the Key Performance Indicators (KPIs) you want to visualize on the dashboard.</p> <p><a href="https://medium.com/@mathiasjr007/creating-interactive-analytics-dashboards-using-pythons-streamlit-43a770bc3194">Read More</a></p>