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

Update pages/Measurement_of_disperssion.py

Browse files
Files changed (1) hide show
  1. pages/Measurement_of_disperssion.py +5 -14
pages/Measurement_of_disperssion.py CHANGED
@@ -28,31 +28,22 @@ st.subheader("Relative Range")
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
  value = num_input.split(",")
48
  for i in value:
49
  if i.isdigit():
50
  list1.append(int(i))
51
- # Check if list1 is not empty and calculate the range
52
- result = absolute_range(list1)
53
- st.write("Absolute Range:", result)
54
-
55
-
56
  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.
57
  It will mostly focus on the central data.
58
  ''')
 
28
  st.latex(r'''
29
  \text{Relative Range} = \frac{\text{Absolute Range}}{\text{Mean}} \times 100
30
  ''')
 
 
 
31
  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(",")
39
  for i in value:
40
  if i.isdigit():
41
  list1.append(int(i))
42
+ if list1:
43
+ result = absolute_range(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
  ''')