Menu

(Solved) : 17 Lab Adjust Values List Normalising Analysing Data Sets Data Human Heights Human Weights Q44075209 . . .

1.7 LAB: Adjust values in a list by normalising When analysingdata sets, such as data for human heights or for human weights, acommon step is to adjust the data. This can be done by normalisingto values between 0 and 1, or throwing away outliers. Write aprogram that first gets a list of integers from input. The inputbegins with an integer indicating the number of integers thatfollow. Then, adjust each integer in the list by subtracting thesmallest value from all the integers.

Ex: If the input is: 5 30 50 10 70 65

the output is: 20 40 0 60 55

The 5 indicates that there are five integers in the list, namely30, 50, 10, 70, and 65. The smallest value in the list is 10, sothe program subtracts 10 from all integers in the list.

Anyone can solve this question in python?

This is my code.

arr1 = []

input = int()

for i in range(0,input):
e = int(intput())
  
arr1.append(e)

k = min(arr1)

for i in range(0,val):
arr1[i] = arr1[i] – k
  
for i in range(0,val):
print(arr1[i])

Here is the error.

Traceback (most recent call last): File “main.py”, line 8, inarr1.append(e) NameError: name ‘e’ is not defined

Expert Answer


Answer to 1.7 LAB: Adjust values in a list by normalising When analysing data sets, such as data for human heights or for human we…

OR