Iris Dataset Visualization with Preswald

Amrutha GujjarAmrutha Gujjarβ€’β€’3 min read

Category: Community


We're thrilled to feature Ishan Madhani in this edition of the Preswald Community Showcase! πŸŽ‰ Ishan has built a clean and insightful Preswald app that brings the famous Iris dataset to life using interactive plots and visual comparisons.

🌟 Project Overview

πŸ“Š Preswald and Flower Classification Analytics

This blog showcases how Preswald is used to visualize the Iris dataset, highlighting distinct patterns across the three iris species using dynamic charts and dashboards.

Project Name: Iris Data Visualization Dashboard
Built by: Ishan Madhani
Dataset: Iris Dataset (Fisher's 1936 classic)
Live App: Explore Iris Dashboard

πŸ“Š Description

Ishan's project provides an elegant interface to:

  • 🌺 Compare petal and sepal dimensions across species

  • πŸ“Š Visualize clusters and relationships between measurements

  • πŸ’‘ Discover the unique characteristics of Setosa, Versicolor, and Virginica

  • πŸ” Use color-coded scatter plots to highlight trends and groupings

Preswald allowed Ishan to turn a foundational machine learning dataset into an engaging, shareable visualization tool with just Python.


πŸš€ Code Snippets

Load and Preview Iris Dataset

from preswald import connect, get_df, text, table

connect()
df = get_df('iris')

text("# Iris Data Dashboard")
text("Visualize species differences across petal and sepal measurements")
table(df.head())

Scatter Plot: Petal Width vs Petal Length

import plotly.express as px
from preswald import plotly

fig = px.scatter(
    df, x="petal_length", y="petal_width",
    color="species", symbol="species",
    title="Petal Length vs Petal Width by Species"
)
plotly(fig)

Box Plot: Sepal Width Distribution

fig = px.box(
    df, x="species", y="sepal_width",
    title="Sepal Width Distribution by Species",
    color="species"
)
plotly(fig)

πŸ“Š Summary Insights

  • Setosa is easily separable based on petal length and width

  • Versicolor and Virginica show more overlap, but cluster distinctly in scatter plots

  • Sepal dimensions offer useful but less discriminative power

  • Interactive filters can help isolate features to support classification


πŸ“Š What is Preswald?

Preswald is an open-source framework for building data apps, dashboards, and internal tools with just Python. It enables developers to turn any analysis script into a shareable app, with UI components like tables, charts, and forms.

Key Features

  • Visual apps from pure Python code

  • Automatic UI generation and state handling

  • Simple one-line deployment

  • Real-time filtering and user interaction


πŸš€ Getting Started

Installation

pip install preswald

Start a Project

preswald init my_project
cd my_project
preswald run

Deploy

preswald deploy --target structured

Huge Thanks to Ishan Madhani!

A big thank you to Ishan Madhani for crafting this beautifully structured dashboard and showcasing the power of data storytelling with Preswald! Explore more of Ishan's work here:

Want to Contribute?

Got a cool idea for a Preswald app? We'd love to see it! Get started here: https://github.com/StructuredLabs/preswald and get featured in our next Community Showcase.

Happy building! πŸš€