lily0n commited on
Commit
6e740c9
Β·
verified Β·
1 Parent(s): 6f1abf4

uploading libraries

Browse files
Files changed (1) hide show
  1. app.py +36 -40
app.py CHANGED
@@ -1,45 +1,41 @@
1
  import streamlit as st
 
 
 
 
 
 
 
2
 
3
  # App Title
4
- st.title("πŸ‹οΈ Streamlit Fitness Advisor")
5
-
6
- # User Input: Age
7
- age = st.slider("Select your age", min_value=10, max_value=80, value=25)
8
-
9
- # User Input: Fitness Goal
10
- goal = st.selectbox(
11
- "What is your main fitness goal?",
12
- ["Lose Weight", "Build Muscle", "Increase Endurance", "General Fitness"]
13
- )
14
-
15
- # User Input: Activity Level
16
- activity_level = st.select_slider(
17
- "How active are you?",
18
- options=["Sedentary", "Lightly Active", "Moderately Active", "Very Active"],
19
- value="Moderately Active"
20
- )
21
-
22
- # Logic for Workout Recommendation
23
- def get_workout_recommendation(age, goal, activity_level):
24
- if goal == "Lose Weight":
25
- if activity_level in ["Sedentary", "Lightly Active"]:
26
- return "πŸƒ 30-45 minutes of cardio (walking, cycling) + light strength training."
27
- else:
28
- return "πŸ‹οΈ HIIT workouts + resistance training 3-4 times per week."
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
- return "🀸 Balanced mix of cardio, strength training, and flexibility exercises."
41
 
42
- # Display Recommendation
43
- recommendation = get_workout_recommendation(age, goal, activity_level)
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.")