Spaces:
Build error
Build error
Update pages/Measurement_of_disperssion.py
Browse files
pages/Measurement_of_disperssion.py
CHANGED
|
@@ -28,21 +28,35 @@ st.subheader("Relative Range")
|
|
| 28 |
st.latex(r'''
|
| 29 |
\text{Relative Range} = \frac{\text{Absolute Range}}{\text{Mean}} \times 100
|
| 30 |
''')
|
|
|
|
|
|
|
|
|
|
| 31 |
def absolute_range(list1):
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
|
|
|
| 35 |
st.title("Calculate Range")
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
st.markdown(''':orange[**Quartile Deviation**] is one of the measure to find the disperssion.In this type the data is divided into 4 equal parts.
|
| 47 |
It will mostly focus on the central data.
|
| 48 |
''')
|
|
|
|
| 28 |
st.latex(r'''
|
| 29 |
\text{Relative Range} = \frac{\text{Absolute Range}}{\text{Mean}} \times 100
|
| 30 |
''')
|
| 31 |
+
import streamlit as st
|
| 32 |
+
import numpy as np
|
| 33 |
+
|
| 34 |
def absolute_range(list1):
|
| 35 |
+
max_val = np.max(list1)
|
| 36 |
+
min_val = np.min(list1)
|
| 37 |
+
return max_val - min_val
|
| 38 |
+
|
| 39 |
st.title("Calculate Range")
|
| 40 |
+
|
| 41 |
+
num_input = st.text_input("Enter the values separated by commas (e.g., 1,2,3,4)", key="num_input")
|
| 42 |
+
|
| 43 |
+
# Initialize list1 to handle the case when num_input is empty
|
| 44 |
+
list1 = []
|
| 45 |
+
|
| 46 |
+
# Process the input only if it's not empty
|
| 47 |
+
if num_input:
|
| 48 |
+
value = num_input.split(",")
|
| 49 |
+
for i in value:
|
| 50 |
+
if i.isdigit():
|
| 51 |
+
list1.append(int(i))
|
| 52 |
+
|
| 53 |
+
# Check if list1 is not empty and calculate the range
|
| 54 |
+
if list1:
|
| 55 |
+
result = absolute_range(list1)
|
| 56 |
+
st.write("Absolute Range:", result)
|
| 57 |
+
else:
|
| 58 |
+
st.write("Please enter valid numbers.")
|
| 59 |
+
|
| 60 |
st.markdown(''':orange[**Quartile Deviation**] is one of the measure to find the disperssion.In this type the data is divided into 4 equal parts.
|
| 61 |
It will mostly focus on the central data.
|
| 62 |
''')
|