So I have a list of objects, each which belong to a particular subclass. I am trying to calculate a running standard deviation as follows:
Label =  Resistance =  m = 0 i = 0 j = 0 for row in Reader: if len(row) == 0 or row == '': i+=1 continue else: Resistance.append(tuple((float(x) if x.strip() else '0.0') for x in row[4:])) i+=1 b1 = Resistance b2 = Resistance b3 = Resistance b4 = Resistance b5 = Resistance b6 = Resistance BR1 =  BR1.append(b1) BR1.append(b2) BR1.append(b3) BR1.append(b4) BR1.append(b5) BR1.append(b6) numsB = array(BR1) print numsB.std(axis=0)
However this returns the error:
print numsB.std(axis=0) TypeError: cannot perform reduce with flexible type
I have been trying various methods to get it to work and I can't seem to figure out what's wrong.
Additionally, you may have noticed I inserted a '0.0' above wherever the excel spreadsheet contains a blank column, however I cannot keep it this way because I am calculating a standard deviation. Could I make it so that when Python calculates the StDev, wherever it encounters a '' it treats it as nothing, rather than zero? Thank you so much.