Question

in Python please 6.8 LAB: Adjust values in a list by normalizing When analyzing data sets,...

in Python please

6.8 LAB: Adjust values in a list by normalizing When analyzing data sets, such as data for human heights or for human weights, a common step is to adjust the data. This can be done by normalizing to values between 0 and 1, or throwing away outliers. Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integers that follow. Then, adjust each integer in the list by subtracting the smallest 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, namely 30, 50, 10, 70, and 65. The smallest value in the list is 10, so the program subtracts 10 from all integers in the list.

1 0
Add a comment Improve this question Transcribed image text
✔ Recommended Answer
Answer #1

Answer:
The desired code in python with relevant comment is given below. Please comment if need more clarity

#normalize.py

#Python 3.8

def normalize():
input_list = []
# taking input from the user
value =input("Please Enter the List in desired format: \n")
val_array = value.split(" ")
# converting the input into list format
i = 1
while i < len(val_array):
input_list.append(int(val_array[i]))
i += 1
# getting minimum value in the list
min_val = min(input_list)
# subtracting minimum value from each elemnt of the list
j = 0
while j < len(input_list):
input_list[j] -= min_val
j += 1
  
return input_list

print(normalize())

- X normalize.py - E:/study/HomeworkLib_solution/normalize.py (3.8.3rc1) File Edit Format Run Options Window Help #Python 3.8 def nOUTPUT SCREENSHOT=>
x Python 3.8.3rc1 Shell Eile Edit Shell Debug Options Window Help Python 3.8.3rcl (tags/v3.8.3rc1:802eb67, Apr 29 2020, 21:39
(plz give me a thums up...if my answer helped you and if any suggestion plz comment, Yr thums up boost me)

Add a comment
Know the answer?
Add Answer to:
in Python please 6.8 LAB: Adjust values in a list by normalizing When analyzing data sets,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • 5.23 LAB: Adjust values in a list by normalizing When analyzing data sets, such as data...

    5.23 LAB: Adjust values in a list by normalizing When analyzing data sets, such as data for human heights or for human weights, a common step is to adjust the data. This can be done by normalizing to values between 0 and 1, or throwing away outliers. Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integers that follow. Then, adjust each integer in the list by...

  • 5.21 LAB: Adjust values in a list by normalizing

    When analyzing data sets, such as data for human heights or for human weights, a common step is to adjust the data. This can be done by normalizing to values between 0 and 1, or throwing away outliers.Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integers that follow. Then, adjust each integer in the list by subtracting the smallest value from all the integers.Ex: If the...

  • NEED IN CORAL LANGUAGE ONLY When analyzing data sets, such as data for human heights or...

    NEED IN CORAL LANGUAGE ONLY When analyzing data sets, such as data for human heights or for human weights, a common step is to adjust the data. This can be done by normalizing to values between 0 and 1, or throwing away outliers. For this program, adjust the values by subtracting the smallest value from all the values. The input consists of five integers. Ex: If the input is 30 50 10 70 65, the output is: 20 40 0...

  • C++ Please   Adjust list by normalizing - functions & arrays No Vectors can be used since...

    C++ Please   Adjust list by normalizing - functions & arrays No Vectors can be used since we haven't learned them yet !! When analyzing data sets, such as data for human heights or for human weights, a common step is to adjust the data. This can be done by normalizing to values between 0 and 1, or throwing away outliers. For this program, adjust the values by subtracting the smallest value from all the values. The input begins with an...

  • Java 6.16 LAB: Adjust list by normalizing

    When analyzing data sets, such as data for human heights or for human weights, a common step is to adjust the data. This adjustment can be done by normalizing to values between 0 and 1, or throwing away outliers. For this program, adjust the values by dividing all values by the largest value. The input begins with an integer indicating the number of floating-point values that follow. Assume that the list will always contain fewer than 20 floating-point values. Output each floating-point value with two digits after the decimal point, which can be achieved as follows: System.out.printf("%.2f", yourValue); Ex: If the input is: 5 30.0 50.0 10.0 100.0 65.0 the output is: 0.30 0.50 0.10 1.00 0.65  The 5 indicates that there are five floating-point values in the list, namely 30.0, 50.0, 10.0, 100.0, and 65.0. 100.0 is the largest value in the list, so each value is divided by 100.0. For coding simplicity, follow every output value by a space, including the last one. import java.util.Scanner;  public class LabProgram {    public static void main(String[] args) {       /* Type your code here. */    } }

  • Write a program that first gets a list of integers from input. The input begins with...

    Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integers that follow. Then, get the last value from the input, and output all integers less than or equal to that value. Ex: If the input is: 5 50 60 140 200 75 100 the output is: 50 60 75 The 5 indicates that there are five integers in the list, namely 50, 60, 140, 200, and 75....

  • Design a program that inputs a list of up to 50 real values from a data...

    Design a program that inputs a list of up to 50 real values from a data file, Problem1InputFile.txt, and print the count and smallest value to the screen. Hint: an array is not really needed, but you can use one. Here is one sample input file for Problem1InputFile.txt (note that there is one real value per line and there is an extra blank line at the end): 10.5 2.1 2.0 -1.7 -0.5 Sample output: Count:       5 Smallest: -1.7 Give pseudocode...

  • in python and can you tell me why i am wrong? Thank you ZyBooks Python M...

    in python and can you tell me why i am wrong? Thank you ZyBooks Python M X zy cS 171: Computer x zy 11.9. LAB: Output x C Write A Program 1 x Slack | Hiu Nguy TG Python Program t x p ython - Getting x +. - 5 x € → e l earn.zybooks.com/zybook/DREXELCS171 Winter2020/chapter/11/section/9 Help/FAQ Kuanyu Lai - = zyBooks Bake My library > CS 171: Computer Programming home> > 11.9: LAB: Output values in a list...

  • There exists a Python variable (a list of lists) called score_card which stores data representing...

    PYTHON 3.7 EXERCISES part 2 Question 1 Question 2 There exists a Python variable (a list of lists) called score_card which stores data representing player results from a golf competition. Each sublist is a triple (i.e., a list of size three) which stores data for one player as follows (in this order): A string representing the player's initials An integer representing the player's gross score An integer representing the player's golfing handicap. A golf player's net score is calculated by...

  • WalMart’s fiscal year starts the first week of February. This means that when analyzing the data,...

    WalMart’s fiscal year starts the first week of February. This means that when analyzing the data, week 26 is actually week 30 (26+4 weeks for January) in 2002 or the end of July 2002. Also, week 52 is actually week 4 (52+4 weeks for January 2002 minus 52 weeks for 2002) in 2003 or the end of January 2003. As an example, the spike in sales (revenue) at week 75 occurs in week 27 (75+4 weeks for January 2002 minus...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT