Generate Scatter Plot from CSV

 import streamlit as st
import pandas as pd
import numpy as np
import os
import io

import matplotlib.pyplot as plt

st.title('Simple Yet Useful Streamlit Dashboard')

# Function to load data
def load_data(uploaded_file=None, file_type=None):
        if uploaded_file is not None:
            if file_type == "csv":
                return pd.read_csv(uploaded_file)
            elif file_type == "xls":
                return pd.read_excel(uploaded_file)
    except Exception as e:
        st.error(f"Failed to load data: {e}")
        return pd.DataFrame()
    # Default data
    return pd.DataFrame(

About this template

An app for editing raw data, uploading CSV files, and handling errors.

Introduction to the Streamlit Dashboard Creator Template

Welcome to the Streamlit Dashboard Creator Template! This template is designed to help you build a simple yet powerful dashboard using Streamlit. With this template, you can upload CSV or XLS files, edit raw data, and visualize it through scatter plots. Additionally, you can view statistical descriptions of your data. This step-by-step guide will walk you through the process of using this template on the Lazy platform.

Getting Started

To begin using this template, simply click on "Start with this Template" on the Lazy platform. This will pre-populate the code in the Lazy Builder interface, so you won't need to copy, paste, or delete any code manually.

Test: Pressing the Test Button

Once you have started with the template, the next step is to press the "Test" button. This will initiate the deployment of your app and launch the Lazy CLI. The Lazy platform handles all the deployment details, so you don't need to worry about installing libraries or setting up your environment.

Entering Input

If the template requires user input, the Lazy App's CLI interface will prompt you for it after you press the "Test" button. Follow the prompts to provide the necessary input for your app.

Using the App

After deployment, you will be able to interact with the Streamlit dashboard interface. Here's how to use it:

  • Upload your CSV or XLS file using the file uploader.
  • If you choose to view the raw data, you can edit it directly in the text area provided.
  • Select variables for the x-axis and y-axis from your dataset to create a scatter plot.
  • View the statistical description of your data by navigating to the 'Statistics' section.

For APIs or displays, Lazy will provide a dedicated server link to use the API or display when you use the Test button. However, this template does not include an API that requires such a link.

Integrating the App

If you need to integrate this dashboard into another service or frontend, you may need to use the server link provided by Lazy after deployment. This link can be added to external tools that support embedding or linking to external web applications.

Remember, no additional setup is required for the 'abilities' module, as it is a built-in module within the Lazy platform.

If you encounter any issues or need further assistance, refer to the documentation provided in the code or reach out to Lazy's customer support for help.

Enjoy building your Streamlit dashboard with Lazy!

Last published
July 20, 2024

More templates like this

MP3ify: Youtube to MP3 Converter

A web application that allows users to download YouTube videos from URLs and provides the option to convert them to MP3 format.


Discord Moderation Bot

The Discord bot monitors all messages in the server. If a message contains profanity, the bot deletes it and sends a warning to the channel. The bot also notifies the host about the deletion via a direct message. Additionally, the bot outputs a helpful error message to a channel if there is a permissions error, guiding the server admin to enable the required permission in the Discord Developer portal.


Streamlit app with sample data

A basic streamlit web app starting point

Generate Scatter Plot from CSV