DOMMETI commited on
Commit
af67c47
·
verified ·
1 Parent(s): e5306e0

Update pages/Measurement_of_disperssion.py

Browse files
Files changed (1) hide show
  1. pages/Measurement_of_disperssion.py +19 -1
pages/Measurement_of_disperssion.py CHANGED
@@ -32,7 +32,7 @@ def absolute_range(list1):
32
  max_val = np.max(list1)
33
  min_val = np.min(list1)
34
  return max_val - min_val
35
- st.title("Calculate Range")
36
  num_input = st.text_input("Enter the values separated by commas (e.g., 1,2,3,4)", key="num_input")
37
  list1 = []
38
  value = num_input.split(",")
@@ -44,6 +44,24 @@ if list1:
44
  st.write("Absolute Range:", result)
45
  else:
46
  st.write("Please enter valid numbers.")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  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.
48
  It will mostly focus on the central data.
49
  ''')
 
32
  max_val = np.max(list1)
33
  min_val = np.min(list1)
34
  return max_val - min_val
35
+ st.title("Calculate Absolute Range")
36
  num_input = st.text_input("Enter the values separated by commas (e.g., 1,2,3,4)", key="num_input")
37
  list1 = []
38
  value = num_input.split(",")
 
44
  st.write("Absolute Range:", result)
45
  else:
46
  st.write("Please enter valid numbers.")
47
+ def relative_range(list1):
48
+ max=np.max(list1)
49
+ min=np.min(list1)
50
+ return (max-min)/(max+min)*100
51
+ st.title("Calculate Relative Range")
52
+ num_input1=st.text_input("Enter the values separated by commas (e.g., 1,2,3,4)", key="num_input1")
53
+ value=num_input1.split(",")
54
+ list1=[]
55
+ for i in value:
56
+ if i.isdigit():
57
+ list1.append(int(i))
58
+ else:
59
+ pass
60
+ if list1:
61
+ result=relative_range(list1)
62
+ st.write("Relative Range",result)
63
+ else:
64
+ st.write("Please enter valid numbers.")
65
  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.
66
  It will mostly focus on the central data.
67
  ''')