QuestionQuestion

Part I:
Your program receives a file (any plain text file named "input.txt" which you create with numbers) to read an array of numbers with open/read/close. The input file has one number per line and it can have as many lines as one wants. Using loop, read the numbers line by line and create an array. Then, using Numpy, calculate mean, median, and standard deviation and print them. An example of 'input.txt' is:
20
30
23
65
32
Extra Credit: Now your "input.txt" has two dimensional array of numbers. them out. You read them and calculate the mean, media, sum for each column and print
20,
21
30,
44
23,
12
65, 55
32,
33

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

# Importing Numpy library
import numpy as np

# Opening input file with data
data_file = open('input1.txt', 'r')

# Creating empty list
data = []

# Reading data_file and appending to the list
for line in data_file:
data.append(float(str.strip(line)))
# Closing input file
data_file.close...

By purchasing this solution you'll be able to access the following files:
Solution.zip.

$18.00
for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Python Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats