Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
import math
|
|
|
|
| 3 |
st.title(":red[**1 : INTRODUCTION TO STATISTICS**]")
|
| 4 |
st.markdown("""_In this field we will be dealing with data by using programing language python. The term DATA
|
| 5 |
ANALYSIS itself say’s that it will be dealing with data. In this we will be collecting the data and
|
|
@@ -154,6 +155,21 @@ st.subheader("Sample Mean Formula")
|
|
| 154 |
st.latex(r'''
|
| 155 |
\bar{x} = \frac{1}{n} \sum_{i=1}^{n} x_i
|
| 156 |
''')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 157 |
st.subheader("Geometric Mean",divider=True)
|
| 158 |
st.subheader("Harmonic Mean",divider=True)
|
| 159 |
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import math
|
| 3 |
+
from functools import reduce
|
| 4 |
st.title(":red[**1 : INTRODUCTION TO STATISTICS**]")
|
| 5 |
st.markdown("""_In this field we will be dealing with data by using programing language python. The term DATA
|
| 6 |
ANALYSIS itself say’s that it will be dealing with data. In this we will be collecting the data and
|
|
|
|
| 155 |
st.latex(r'''
|
| 156 |
\bar{x} = \frac{1}{n} \sum_{i=1}^{n} x_i
|
| 157 |
''')
|
| 158 |
+
def arthamatic_mean(list1):
|
| 159 |
+
sum=reduce(lambda x,y: x+y,list1)
|
| 160 |
+
return sum/len(list1)
|
| 161 |
+
st.title("Calculate Arthamatic_Mean")
|
| 162 |
+
numbers_input_2 = st.text_input("Enter a list of numbers separated by commas (e.g., 1, 2, 3, 4, 5):", key="numbers_input_2")
|
| 163 |
+
if numbers_input_2:
|
| 164 |
+
parts=numbers_input_2.split(",")
|
| 165 |
+
list1=[]
|
| 166 |
+
for i in numbers_input_2:
|
| 167 |
+
list1.append(int(num))
|
| 168 |
+
if list1:
|
| 169 |
+
result=arthamatic_mean(list1)
|
| 170 |
+
st.write("Arthamatic_Mean",result)
|
| 171 |
+
else:
|
| 172 |
+
st.write("No valid numbers provided.")
|
| 173 |
st.subheader("Geometric Mean",divider=True)
|
| 174 |
st.subheader("Harmonic Mean",divider=True)
|
| 175 |
|