Spaces:
Build error
Build error
uploading libraries
Browse files
app.py
CHANGED
|
@@ -1,45 +1,41 @@
|
|
| 1 |
import streamlit as st
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
# App Title
|
| 4 |
-
st.title("
|
| 5 |
-
|
| 6 |
-
#
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
"
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
)
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
elif goal == "Build Muscle":
|
| 31 |
-
if age < 30:
|
| 32 |
-
return "πͺ Strength training 4-5 times per week + protein-rich diet."
|
| 33 |
-
else:
|
| 34 |
-
return "πͺ Focus on compound lifts (squats, deadlifts) + adequate recovery."
|
| 35 |
-
|
| 36 |
-
elif goal == "Increase Endurance":
|
| 37 |
-
return "πββοΈ Running, cycling, or swimming 4-6 times per week with progressive overload."
|
| 38 |
-
|
| 39 |
else:
|
| 40 |
-
|
| 41 |
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
st.subheader("π Your Personalized Workout Plan:")
|
| 45 |
-
st.write(recommendation)
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
import pandas as pd
|
| 3 |
+
import matplotlib.pyplot as plt
|
| 4 |
+
import seaborn as sns
|
| 5 |
+
import numpy as np
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
|
| 9 |
|
| 10 |
# App Title
|
| 11 |
+
st.title("π Streamlit Data Analysis Tool")
|
| 12 |
+
|
| 13 |
+
# Upload CSV File
|
| 14 |
+
uploaded_file = st.file_uploader("Upload a CSV file", type=["csv"])
|
| 15 |
+
|
| 16 |
+
if uploaded_file:
|
| 17 |
+
df = pd.read_csv(uploaded_file)
|
| 18 |
+
st.write("### Preview of Uploaded Data")
|
| 19 |
+
st.dataframe(df.head())
|
| 20 |
+
|
| 21 |
+
# Dropdown for column selection
|
| 22 |
+
numeric_cols = df.select_dtypes(include=['number']).columns.tolist()
|
| 23 |
+
if numeric_cols:
|
| 24 |
+
col_to_analyze = st.selectbox("Select a column to analyze", numeric_cols)
|
| 25 |
+
|
| 26 |
+
# Summary statistics
|
| 27 |
+
st.write("### Summary Statistics")
|
| 28 |
+
st.write(df[col_to_analyze].describe())
|
| 29 |
+
|
| 30 |
+
# Histogram Slider
|
| 31 |
+
bins = st.slider("Number of bins for histogram", min_value=5, max_value=50, value=20)
|
| 32 |
+
|
| 33 |
+
# Plot Histogram
|
| 34 |
+
fig, ax = plt.subplots()
|
| 35 |
+
sns.histplot(df[col_to_analyze], bins=bins, kde=True, ax=ax)
|
| 36 |
+
st.pyplot(fig)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
else:
|
| 38 |
+
st.warning("No numeric columns found in the dataset.")
|
| 39 |
|
| 40 |
+
else:
|
| 41 |
+
st.info("Please upload a CSV file to get started.")
|
|
|
|
|
|