I can't work out why when i try to print the list(listProb....s) it prints the empty list, i'm not setting them to the empty list after this code or anything, and when i print the normDistProb's on their own it prints fine):

for i in range(0,12):
listProbFog.append(normDistProb(dayValues[i], fogAve[i], fogVar[i]))
listProbSnow.append(normDistPr...ob(dayValues[i], snowAve[i], snowVar[i]))
listProbRain.append(normDistProb(dayValues[i], rainAve[i], rainVar[i]))
listProbNone.append(normDistProb(dayValues[i], noneAve[i], noneVar[i]))

Thanks

p.s. listProb's are indented

Edited 5 Years Ago by spe_eddy: n/a

What does the function normDistProb return? The first attempt to debug this should be to print it

for i in range(0,12):
    listProbFog.append(normDistProb(dayValues[i], fogAve[i], fogVar[i]))
    print normDistProb(dayValues[i], fogAve[i], fogVar[i])
    print listProbFog
    # the other lists are just extra cruft until you get this problem solved

Edited 5 Years Ago by woooee: n/a

Comments
agree

Maybe the listProb lists have already an empty list inside after entering the loop. You can print their content before entering the loop.

I guess that normDistProb returns an empty list somehow.

i got it - my normDistProb functioned looped popping elements from the list so it worked whilst inside the loop and the desired results were obtained, so basically there was no way anyone could answer this question with the information i provided, sorry!

This question has already been answered. Start a new discussion instead.