Interactive Dashboard with Streamlit, Pandas, and Plotly

Firda Della Irawan
2 min readOct 24, 2022

--

Image Final Project by author

On this part, we are going to over the step-by-step to make an interactive dashboard with streamlit, pandas, and plotly and publish it on huggingface.co

we are going to use retail banking-demo dataset on Kaggle. This is free for commercial use. We can get some insight from there are useful. You can see the description of the dataset on data.world.

First, we build the streamlit using google collab. Create new spaces using your hugging face account and select ‘Streamlit’ to the space SDK. Choose private if you want the project to be private or public if you want other people to see your project.

read this if you lose understanding streamlit SDK or streamlit hub: https://huggingface.co/docs/hub/spaces-sdks-streamlit

Then, open your google collab, and start by cloning the repo using Git clone. and then commit and push

git add app.py
git commit -m "Add application file"
git push

and yeah you are connected to hugging face using google collab.

the library we are going to use are

import streamlit as st
import seaborn as sns
import pandas as pd
import numpy as np
import plotly.express as px
import plotly.graph_objects as go
import matplotlib.pyplot as plt

add requirements.txt file, this is a file listing all the dependencies for a specific Python project. So, upload the dataset by click Create File to create a folder for the dataset or upload a file dataset you want.

Retail Banking — a Hugging Face Space by author

You can see the final version of this project here: Explore Retail Banking Dashboard Streamlit

After making this, we have learned a lot of new things
1. connect huggingface to google collab
2. Learn how to create beautiful visualizations
3. learn to use pandas and plotly

Inisght we can get from the interactive dashboard are

  1. Most customers in the age range of 20–30 years
  2. Show customer behavior by see the frequency and amount they have paid
  3. duration they pay every year
  4. the trend of debt payments based on customer categories is quite high

etc…

So, we have to keep learning. And just keep in mind the programming language we used on this project is Python.

Thanks for reading, I hope it’s useful. suggestions and feedback will be very valuable so you can connect to Twitter or LinkedIn to talk to much

--

--

No responses yet