Hi,
I would like to know how can I access the files uploaded with st.file_uploader.
I wrote these lines of code:
with st.sidebar:
path = st.file_uploader("Choose a CSV file", accept_multiple_files=True)
for uploaded_file in path:
uploaded_file = pd.read_csv(uploaded_file, sep=';', decimal=',')
I am trying to load 4 .csv files. They are loaded but then I don’t know how can I access them to keep working on those files.
For example, one of those files is called “vertical.csv”. How can I use that specific file after being imported?
Thank you for your answer.
I tried to use your code but it didn’t work very well. The following error was shown EmptyDataError: No columns to parse from file.
I know that if I set accept_multiple_files = True I will get a list of files. The problem is, for example, I load 4 .csv files. Then I want to get access to each file. For example, one is called “vertical.csv”. How can I access that specific file to remove its first column? Is there any way to choose the file by its name after load all the files?
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.