Streamlit loading column data takes too much time

I use simple code snippet in streamlit which shows dataframe consisting of excel which i have. the problem is that it takes too much time to load data inside the filter column of streamlit area. in that filter area i make search on material name, but it takes even 30 seconds to load and show me the data which i am gonna select. How to solve it and make it fastest to select data?

The code is:

import streamlit as st
import pandas as pd

def load_data(nrows):
    return df


species = st.multiselect('SELECT THE MATERIAL', df['Name'])
new_df = df[(df['Name'].isin(species))]

and to show how it is too slow selecting data, look at this:

1 Like

Hi @M11,
thanks for your question. You are applying the multiselect box on 100,000 items, right? The multiselect itself is not designed to handle so many items. I think it may make sense to have a different widget that is a speed optimized search box. This question keeps coming up, though. I will open a github issue for this.


1 Like