import streamlit as st
import pandas as pd
import numpy as np
# Create some sample data
x = np.linspace(0, 10, 100)
y = np.sin(x)
# Add some text
st.title('Simple Streamlit App')
st.write('Welcome! This is a basic demonstration of Streamlit.')
# Display the data
st.subheader('Sample Data')
df = pd.DataFrame({
'x': x,
'y': y
})
st.dataframe(df.head())
# Create some plots
st.subheader('Line Plot')
st.line_chart(df.set_index('x'))
st.subheader('Area Chart')
st.area_chart(df.set_index('x'))
# Add interactive elements
st.subheader('Interactive Elements')
name = st.text_input('Enter your name')
if name:
st.write(f'Hello {name}!')
Hi! I can help you with any questions about Streamlit and Python. What would you like to know?