destiratnakomala's picture
Rename App.py to app.py
fcb76ef verified
import streamlit as st
import pandas as pd
# Set Streamlit theme
st.set_page_config(page_title="Power BI-like Dashboard", page_icon=":chart_with_upwards_trend:")
# Upload CSV file
uploaded_file = st.file_uploader("Choose a CSV file", type="csv")
# Custom CSS styles
custom_styles = """
body {
background-color: #f4f4f4;
}
.css-1k6zjxx {
max-width: none;
}
"""
# Apply custom CSS
st.markdown(f'<style>{custom_styles}</style>', unsafe_allow_html=True)
if uploaded_file is not None:
# Read data from CSV
df = pd.read_csv(uploaded_file)
# Display raw data in compact layout
st.subheader("Raw Data")
st.dataframe(df, height=400)
# Basic statistics in compact layout
st.subheader("Basic Statistics")
st.dataframe(df.describe(), height=200)
# Select columns for analysis
selected_columns = st.multiselect("Select columns for analysis", df.columns)
if selected_columns:
# Line chart in compact layout
st.subheader("Line Chart")
st.line_chart(df[selected_columns], use_container_width=True)
# Bar chart in compact layout
st.subheader("Bar Chart")
st.bar_chart(df[selected_columns], use_container_width=True)
# Area chart in compact layout
st.subheader("Area Chart")
st.area_chart(df[selected_columns], use_container_width=True)
# Interactive table in compact layout
st.subheader("Interactive Table")
st.dataframe(df[selected_columns], height=400)