Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

bList1 = [] sList1 = [] sAv = [] sOut = [] for sList in bList: av = np.average(sList) std = np.std(sList) for sVal in

bList1 = [] sList1 = [] sAv = [] sOut = []

for sList in bList:

av = np.average(sList) std = np.std(sList)

for sVal in sList:

if abs(sVal-av) < 2*std: sList1.append(sVal)

else: sOut.append(sVal)

av1 = np.average(sList1) sAv.append(av1) bList1.append(sList1)

print(sAv)

So I have a main list, bList, with list items in it, sList

For each sList in bList,

-> find the mean and standard dev. for that sList

then -> for each item, sVal, in that sList, see if that item meets criteria

if yes -> add to new list, sList1

if no -> add to new list, sOut

-> then find the mean for the newly created sList1, and add that to new list, sAv

in total I should have 13 new means in sAv, instead I have 3300+ lines of data!

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

Flash XML Applications Use AS2 And AS3 To Create Photo Galleries Menus And Databases

Authors: Joachim Schnier

1st Edition

0240809173, 978-0240809175

More Books

Students also viewed these Databases questions