import pandas as pd import streamlit as st from plot_data import plotly_plot def main(): st.markdown("

Datenanalyse

", unsafe_allow_html=True) uploaded_file = st.file_uploader("CSV hochladen", type=["csv"]) if uploaded_file is not None: try: df = pd.read_csv(uploaded_file) except pd.errors.EmptyDataError: st.error("Fehler: Leere CSV Datei") except Exception as e: st.error(f"Error: {str(e)}") if uploaded_file is not None: mittelwert = st.slider("Gleitender Mittelwert", 0, 1000, 0, 10) time_column = st.selectbox("Zeit auswählen", df.columns, index=0) data_column = st.selectbox("Daten auswählen", df.columns) try: fig = plotly_plot(df, time_column, data_column, mittelwert) fig.update_layout(width = 1600, height = 600) st.plotly_chart(fig) except Exception as e: st.error(f"Error: {str(e)}") if __name__ == "__main__": main()