Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(python)Write a function that takes in a list of lists of equal length and then produces their average list, i.e. this is a list where

(python)Write a function that takes in a list of lists of equal length and then produces their average list, i.e. this is a list where the entry in index [i] is the average of all the given entries in index [i].

def avgList(myList): # YOUR CODE HERE raise NotImplementedError()

assert sum([abs(avgList([[1, 1, 1],[2, 2, 2]])[i]- [1.5, 1.5, 1.5][i]) for i in range(3)]) <= .1 assert sum([abs(avgList([[1, 2, 3],[3, 2, 1]])[i]- [2.0, 2.0, 2.0][i]) for i in range(3)]) <= .1 assert sum([abs(avgList([[1, 2, 3],[3, 2, 1],[1, 3, 2]])[i]- [1.66, 2.33, 2.0][i]) for i in range(3)]) <= .2 assert sum([abs(avgList([[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1]])[i]- [2.0, 2.0, 2.0][i]) for i in range(3)]) <= .2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DNA Databases

Authors: Stefan Kiesbye

1st Edition

0737758910, 978-0737758917

More Books

Students also viewed these Databases questions

Question

3. Existing organizations and programs constrain behavior.

Answered: 1 week ago