DOMMETI commited on
Commit
5ee5985
·
verified ·
1 Parent(s): 11280d3

Rename pages/Measurement_of_Central_Tendency.py to pages/5_Measurement_of_Central_Tendency.py

Browse files
pages/{Measurement_of_Central_Tendency.py → 5_Measurement_of_Central_Tendency.py} RENAMED
@@ -157,4 +157,41 @@ if numbers_input:
157
  result = median(numbers_input)
158
  st.write("Median result:", result)
159
  else:
160
- st.write("No valid numbers provided.")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
157
  result = median(numbers_input)
158
  st.write("Median result:", result)
159
  else:
160
+ st.write("No valid numbers provided.")
161
+ st.subheader("Mean")
162
+ st.markdown("""
163
+ 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
164
+ effected by outliers.Based on the data we will compute the mean in three types""",unsafe_allow_html=True)
165
+ st.subheader("Arthmetic Mean")
166
+ st.markdown("""Arthmetic Mean is used on data which have
167
+ <ul class=icon-bullet>
168
+ <li>Interval and Ratio Data </li>
169
+ <li>Symmetric Distributions </li>
170
+ <li>Data Without Outliers</li>
171
+ </ul>
172
+ """,unsafe_allow_html=True)
173
+ st.subheader("Population Mean Formula")
174
+ st.latex(r'''
175
+ \mu = \frac{1}{N} \sum_{i=1}^{N} x_i
176
+ ''')
177
+ st.subheader("Sample Mean Formula")
178
+ st.latex(r'''
179
+ \bar{x} = \frac{1}{n} \sum_{i=1}^{n} x_i
180
+ ''')
181
+ def arthamatic_mean(list1):
182
+ sum=reduce(lambda x,y: x+y,list1)
183
+ return sum/len(list1)
184
+ st.title("Calculate Arthmetic_Mean")
185
+ 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")
186
+ if numbers_input_2:
187
+ parts=numbers_input_2.split(",")
188
+ list1=[]
189
+ for i in parts:
190
+ i = i.strip()
191
+ if i.isdigit():
192
+ list1.append(int(i))
193
+ if list1:
194
+ result=arthamatic_mean(list1)
195
+ st.write("Arthmetic_Mean",result)
196
+ else:
197
+ st.write("No valid numbers provided.")