My StreamLit Sprint: Precise GPT-4 Prompting For Dashboard Visuals
Last Updated on January 29, 2024 by Editorial Team
Author(s): John Loewen, PhD
Originally published on Towards AI.
Medal-worthy Olympic data visuals with modular prompting
Dall-E image: thick dripping oil painting of the (inaccurate) dashboard displayed on a computer screen
With GPT-4, even a complete Streamlit beginner can use the Python StreamLit library to create a data visualization masterpiece.
How do I know this? I am a decent Python coder with ZERO experience using Streamlit — and I conjured up in minutes what would have taken me hours, or even days, without the help of GPT-4 prompting.
In a short span of time, I was able to create:
a StreamLit map showing data counts by countrya StreamLit bar chart showing the top 10 amounts by countrya StreamLit line chart showing trends from year to year for the top 10 countries
How? Using well-formulated modular prompts.
Let me show the four easy steps to a StreamLit dashboard showcasing Olympic medal winners.
The data used to accomplish this task is the “Olympic Medals by Country” dataset. It is available on Kaggle, HERE.
In this dataset, the data is organized by year, country, and a count of “Gold”, “Silver” and “Bronze” medals. For the sake of a more “complete” set of data points, we will just extract the totals since 1992 (when all Eastern European countries joined independently).
First, we need to load the dataset from the… Read the full blog for free on Medium.
Join thousands of data leaders on the AI newsletter. Join over 80,000 subscribers and keep up to date with the latest developments in AI. From research to projects and ideas. If you are building an AI startup, an AI-related product, or a service, we invite you to consider becoming a sponsor.
Published via Towards AI
Towards AI Academy
We Build Enterprise-Grade AI. We'll Teach You to Master It Too.
15 engineers. 100,000+ students. Towards AI Academy teaches what actually survives production.
Start free — no commitment:
→ 6-Day Agentic AI Engineering Email Guide — one practical lesson per day
→ Agents Architecture Cheatsheet — 3 years of architecture decisions in 6 pages
Our courses:
→ AI Engineering Certification — 90+ lessons from project selection to deployed product. The most comprehensive practical LLM course out there.
→ Agent Engineering Course — Hands on with production agent architectures, memory, routing, and eval frameworks — built from real enterprise engagements.
→ AI for Work — Understand, evaluate, and apply AI for complex work tasks.
Note: Article content contains the views of the contributing authors and not Towards AI.