File size: 567 Bytes
7aa8120
2ed954e
7aa8120
2ed954e
7aa8120
2ed954e
7aa8120
2ed954e
7aa8120
2ed954e
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import streamlit as st
import pandas as pd

st.set_page_config(page_title="CSV Viewer", layout="wide")

st.title("Simple CSV Viewer")

uploaded_file = st.file_uploader("Upload a CSV file", type=["csv"])

if uploaded_file is not None:
    try:
        df = pd.read_csv(uploaded_file)
        st.success("File successfully uploaded and loaded.")
        st.subheader("Preview of the uploaded CSV")
        st.dataframe(df)
    except Exception as e:
        st.error(f"Error reading the file: {e}")
else:
    st.info("Please upload a CSV file to display its contents.")