Pandas
Pandas is a library that offers data structures and operations for manipulating numerical tables
See Pandas documentation for more details
1 - Upload file
2 - Read file into python
Decode the base64 string into a file type
file_data = io.BytesIO(base64.b64decode(file.split(";base64,")[1]))
and then read the file as a csv
df = pd.read_csv(file_data)
and if that fails, read it as an excel
df = pd.read_excel(file_data)
3 - Return file as html
Use .to_html() to convert the Panda's Dataframe into a HTML string
return {
"df": df.to_html()
}
4 - Display the outputs
Get the df variable from the outputs keyword
a link to our github, which contains a grocery store data file:
https://github.com/KaidenMastel/Grocery-Mapper
Copyright © MecSimCalc 2025
Terms | Privacy