Spaces:
Sleeping
Sleeping
File size: 415 Bytes
5d4981c |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
import pandas as pd
import streamlit as st
def load_uploaded_file(uploaded_file) -> pd.DataFrame | None:
filename = uploaded_file.name.lower()
if filename.endswith(".csv"):
return pd.read_csv(uploaded_file)
elif filename.endswith(".parquet"):
return pd.read_parquet(uploaded_file)
else:
st.error("Unsupported file type. Please upload a CSV or Parquet file.")
return |