replicate this app: import streamlit as st import pandas as pd @st.cache def load_data(nrows): df=pd.read_excel('materials.xlsx',nrows=nrows) return df df=load_data(100000) species = st.multiselect('SELECT THE MATERIAL', df['Name']) new_df = df[(df['Name'].isin(species))] st.write(new_df) the excel file which has 20,000 rows by the way and to show how it is too slow selecting data, look at this: https://streamable.com/kjis2 --- we don't have access to the file so just generate some random data, generate a data frame with 100k rows
To upload files, please first save the app
import pandas as pd
import numpy as np
import streamlit as st
@st.cache_data
def load_data(nrows):
names = [f'Material {i}' for i in range(1, 20001)] * 5 # Repeat for 100k rows
random_indices = np.random.randint(0, len(names), nrows)
df = pd.DataFrame({'Name': [names[i] for i in random_indices]})
return df
df = load_data(100000)
species = st.multiselect('SELECT THE MATERIAL', df['Name'].unique())
new_df = df[df['Name'].isin(species)]
st.write(new_df)
Hi! I can help you with any questions about Streamlit and Python. What would you like to know?