Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -65,6 +65,7 @@ checking the frequency in list we come across a situtaion where we will find thr
|
|
| 65 |
st.markdown(''':violet[Multi_Mode] \n Let's understand why this situation raises for example let's take list of numbers [1,1,2,2,3,3,4,4,5]. here by
|
| 66 |
checking the frequency in list we come across a situtaion where we will find more than three maximun frequecy repeated value hence the output will be Multi_Mode.
|
| 67 |
''')
|
|
|
|
| 68 |
def mode(*args):
|
| 69 |
list1 = list(args)
|
| 70 |
dict1 = {}
|
|
@@ -113,22 +114,17 @@ st.latex(r'''
|
|
| 113 |
\text{Median} = \frac{X_{\left(\frac{n}{2}\right)} + X_{\left(\frac{n}{2}+1\right)}}{2}
|
| 114 |
''')
|
| 115 |
def median(list1):
|
| 116 |
-
list1.sort()
|
| 117 |
length = len(list1)
|
| 118 |
-
|
| 119 |
if length % 2 == 0:
|
| 120 |
-
# For even length, calculate the average of the two middle values
|
| 121 |
mid1 = length // 2 - 1
|
| 122 |
mid2 = length // 2
|
| 123 |
return (list1[mid1] + list1[mid2]) / 2
|
| 124 |
else:
|
| 125 |
-
# For odd length, return the middle value
|
| 126 |
mid = length // 2
|
| 127 |
return list1[mid]
|
| 128 |
-
|
| 129 |
st.title("Calculate Median")
|
| 130 |
numbers_input_1 = st.text_input("Enter a list of numbers separated by commas (e.g., 1, 2, 3, 4, 5):", key="numbers_input_1")
|
| 131 |
-
|
| 132 |
if numbers_input_1:
|
| 133 |
parts = numbers_input_1.split(',')
|
| 134 |
list1 = []
|
|
@@ -142,5 +138,23 @@ if numbers_input_1:
|
|
| 142 |
result = median(list1)
|
| 143 |
st.write("Median result:", result)
|
| 144 |
else:
|
| 145 |
-
st.write("No valid numbers provided.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 146 |
|
|
|
|
| 65 |
st.markdown(''':violet[Multi_Mode] \n Let's understand why this situation raises for example let's take list of numbers [1,1,2,2,3,3,4,4,5]. here by
|
| 66 |
checking the frequency in list we come across a situtaion where we will find more than three maximun frequecy repeated value hence the output will be Multi_Mode.
|
| 67 |
''')
|
| 68 |
+
st.title("Mode")
|
| 69 |
def mode(*args):
|
| 70 |
list1 = list(args)
|
| 71 |
dict1 = {}
|
|
|
|
| 114 |
\text{Median} = \frac{X_{\left(\frac{n}{2}\right)} + X_{\left(\frac{n}{2}+1\right)}}{2}
|
| 115 |
''')
|
| 116 |
def median(list1):
|
| 117 |
+
list1.sort()
|
| 118 |
length = len(list1)
|
|
|
|
| 119 |
if length % 2 == 0:
|
|
|
|
| 120 |
mid1 = length // 2 - 1
|
| 121 |
mid2 = length // 2
|
| 122 |
return (list1[mid1] + list1[mid2]) / 2
|
| 123 |
else:
|
|
|
|
| 124 |
mid = length // 2
|
| 125 |
return list1[mid]
|
|
|
|
| 126 |
st.title("Calculate Median")
|
| 127 |
numbers_input_1 = st.text_input("Enter a list of numbers separated by commas (e.g., 1, 2, 3, 4, 5):", key="numbers_input_1")
|
|
|
|
| 128 |
if numbers_input_1:
|
| 129 |
parts = numbers_input_1.split(',')
|
| 130 |
list1 = []
|
|
|
|
| 138 |
result = median(list1)
|
| 139 |
st.write("Median result:", result)
|
| 140 |
else:
|
| 141 |
+
st.write("No valid numbers provided.")
|
| 142 |
+
st.subheader("Mean",divider=True)
|
| 143 |
+
st.markdown("""
|
| 144 |
+
Mean is one of the beautiful measurement of central tendency it invovles all the data present in it.The only drawback of mean is it is
|
| 145 |
+
effected by outliers.Based on the data we will compute the mean in three types""")
|
| 146 |
+
st.subheader("Arthamatic Mean",divider=True)
|
| 147 |
+
st.markdown("""Arthamatic Mean is used on data which have \n * Interval and Ratio Data \n * Symmetric Distributions \n * Data Without Outliers
|
| 148 |
+
""")
|
| 149 |
+
st.subheader("Population Mean Formula")
|
| 150 |
+
st.latex(r'''
|
| 151 |
+
\mu = \frac{1}{N} \sum_{i=1}^{N} x_i
|
| 152 |
+
''')
|
| 153 |
+
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 |
+
|
| 160 |
|