Generate Scatter Plot from CSV

By
 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
@st.cache_data
def load_data(uploaded_file=None, file_type=None):
    try:
        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!

Technology
Last published
April 7, 2024

More templates like this

Customisable Server Status Dashboard

This template allows you to create a dashboard to report about incidents regarding your server to your users.

Streamlit
Python

A bot that answers questions about data

Ask questions about your database via a chat bot. This chatbot connects to a SQLITE database, generates queries for it based on the schema and then runs the queries printing the response all in a nicely styled chat UI. This template is pre-loaded with sample data (car parts) to play around with - here are the sample data columns that you can query: part_number, part_name, price, units_left_in_stock, manufacturer .

Python
Flask

WhatsApp Bot Builder

The WhatsApp Bot Builder app allows users to create a WhatsApp bot that responds to every message with "Hello World".

WhatsApp
Twilio
Python
Home
/
Generate Scatter Plot from CSV