Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

streamlit button to load a file

uploaded_file = st.file_uploader("Choose a file")
if uploaded_file is not None:
     # To read file as bytes:
     bytes_data = uploaded_file.getvalue()
     st.write(bytes_data)

     # To convert to a string based IO:
     stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))
     st.write(stringio)

     # To read file as string:
     string_data = stringio.read()
     st.write(string_data)

     # Can be used wherever a "file-like" object is accepted:
     dataframe = pd.read_csv(uploaded_file)
     st.write(dataframe)
Comment

PREVIOUS NEXT
Code Example
Python :: fill pixels with zeros python opencv 
Python :: flask oneid 
Python :: How to convert ton to kg using python 
Python :: How to find all primes less than some upperbound efficiently? 
Python :: find frequency of each word in a string in python using dictionary 
Python :: how to convert list to tensor pytorch 
Python :: # list all keywords in Python 
Python :: ValueError: There may be at most 1 Subject headers in a message 
Python :: np install python 
Python :: pandas plot heatmap 
Python :: add element to heap python 
Python :: plt.imshow not showing 
Python :: wxpython custom dialog 
Python :: the four pillars of Op in Python 
Python :: remove duplicate space in string in pytoon 
Python :: open administrator command prompt using python 
Python :: matplotlib bold 
Python :: how to launch jupyter notebook from cmd 
Python :: howt to make caluclator in python 
Python :: phi 
Python :: browser refresh selenium python 
Python :: import data in pandad 
Python :: drawkeypoints cv2 
Python :: how to delete everything on a file python 
Python :: sns time series plot 
Python :: remove duplicates without changing order python 
Python :: scipy rfft 
Python :: drop rows with certain values pandas 
Python :: wtform custom validator example 
Python :: remove characters in array of string python 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =