Questions tagged [streamlit]

Questions about Streamlit and custom machine learning models in Streamlit.

Streamlit lets you create apps for your machine learning projects with deceptively simple Python scripts. It supports hot-reloading, so your app updates live as you edit and save your file. No need to mess with HTTP requests, HTML, JavaScript, etc. All you need is your favorite editor and a browser. Learn more at https://github.com/streamlit/streamlit.

1822 questions
7
votes
1 answer

How to post JSON data to FastAPI and retrieve the JSON data inside the endpoint?

I would like to pass a JSON object to a FastAPI backend. Here is what I am doing in the frontend app: data = {'labels': labels, 'sequences': sequences} response = requests.post(api_url, data = data) Here is how the backend API looks like in…
MGLondon
  • 1,557
  • 15
  • 18
7
votes
4 answers

EmptyDataError: No columns to parse from file about streamlit

I am using streamlit version v0.68 and currently working on CSV file for data analysis. st.title('Report Analysis') uploaded_file = st.file_uploader("Choose a file") if uploaded_file is not None: data = pd.read_csv(uploaded_file,…
Swarnim Kumar
  • 335
  • 5
  • 21
7
votes
2 answers

Add labels x axis and y axis for streamlit line_chart

I would like to add labels for the x and y-axis for my simple line_chart in streamlit. The plotting command is st.line_chart(df[["capacity 1", "capacity 2"]]) which plots a line_chart with 2 lines (capacity 1 and capacity 2). Is there a simple…
user3550552
  • 167
  • 1
  • 13
6
votes
4 answers

Put logo and title above/on top of page navigation in sidebar of streamlit multipage app

I am using the new multipage feature and would like to style my multipage app and put a logo with a title on top of/before the page navigation. Here's a small example tested on Python 3.9 with streamlit==1.11.1 in the following directory…
Cord Kaldemeyer
  • 6,405
  • 8
  • 51
  • 81
6
votes
1 answer

Streamlit timeout: Your app is having trouble loading the component

I am trying to display a Streamlit/Hydralit component but, as soon as I deploy it on Cloud Run, I encounter this timeout error (never encountered locally): Your app is having trouble loading the hydralit_components.NavBar.nav_bar component. (The…
Alessandro Ceccarelli
  • 1,775
  • 5
  • 21
  • 41
6
votes
1 answer

Hyperlink in Streamlit dataframe

I am attempting to display a clickable hyperlink inside a dataframe containing filtered results on Streamlit. This is my code so far: import pandas as pd import streamlit as st import openpyxl import numpy as np from IPython.core.display import…
May Mammaz
  • 61
  • 1
  • 3
6
votes
2 answers

How to hide dataframe index on streamlit?

I want to use some pandas style resources and I want to hide table indexes on streamlit. I tryed this: import streamlit as st import pandas as pd table1 = pd.DataFrame({'N':[10, 20, 30], 'mean':[4.1, 5.6,…
Juka
  • 118
  • 1
  • 9
6
votes
1 answer

How to cache a plot in streamlit?

I have built a dashboard in streamlit where you can select a client_ID and have SHAP plots displayed (Waterfall and Force plot) to interpret the prediction of credit default for this client. I also want to display a SHAP summary plot with the whole…
vpvinc
  • 155
  • 2
  • 10
6
votes
5 answers

ModuleNotFoundError: No module named 'streamlit.cli'

I have an error when I deploy streamlit app on Heroku. How can I deal with ?
Jim Ya
  • 61
  • 1
  • 1
  • 2
6
votes
3 answers

Select multiple options in checkboxes in Streamlit

I am new to Streamlit. I want to make a multiple-choice user input (checkboxes). But I want to select a maximum of 3 options out of 4 options. I have tried with the dropdown feature of multiselect. import streamlit as st option =…
raf
  • 225
  • 1
  • 3
  • 13
6
votes
1 answer

Plotting spatial data on individual map using altair

I want to plot spatial data on a map. I want to use streamlit because it seems to be easy to use and I want to explore it a bit. First a tried plotting my data with their inbuilt deck_gl-API. This worked pretty good, but since I need to plot…
raphael_mav
  • 580
  • 6
  • 23
6
votes
1 answer

Why does my Streamlit application open multiple times?

I am trying to start the Streamlit application using import os os.popen("streamlit run stockXchange.py") When I run this code, there will be an infinite number of streamlit windows, popping up one after another every 3 or so seconds. The only way…
mime
  • 302
  • 1
  • 6
  • 21
6
votes
1 answer

How to animate a line chart in a streamlit page

I am working with a ML project and I want to display in (relative) real time a chart with a fitness function. I am using code from this SO answer and it works fine as long as the chart is displayed in the matplotlib window. As soon as I add it to…
Cristian Cotoi
  • 163
  • 1
  • 7
5
votes
1 answer

Session state is reset in Streamlit multipage app

I'm building a Streamlit multipage application and am having trouble keeping session state when switching between pages. My main page is called mainpage.py and has something like the following: import streamlit as st if "multi_select" not in…
MvdD
  • 22,082
  • 8
  • 65
  • 93
5
votes
1 answer

Is there a way to make a vertically scrollable list of elements in streamlit?

I was searching for ways to make a scrollable list of elements or even a way to fix the height of a column or a container and make it scrollable, so that a long list of elements would remain in the viewport and users wouldn't have to scroll to the…
ElVincitore
  • 355
  • 2
  • 12