Python - TypeError: float() argument must be a string or a number, not 'list -


python newbie here. trying operate on lists contain floating point numbers. avg list parameter returned different method. however, when tried doing following, throws me error float() should have string or number , not list. avg1 should contain copy of lists float-type numbers instead of lists right? tried few edits read on other posts similar titles, couldn't solve this. starting out kindly tell me going wrong.

def movingavg(ema,avg):          ema=[]     avg1 = [float(i) in avg]     ema[:3] = avg1[:3]     i,j in zip(ema[2:],avg1[3:]):         =float(i)*0.67 + float(j)*0.33         ema.append(a)     return ema 

the error follows :

avg1 = [float(i) in avg] typeerror: float() argument must string or number, not 'list' 

using python 3.4

please check return type of avg think it's return type list's of list.


Comments

Popular posts from this blog

serialization - Convert Any type in scala to Array[Byte] and back -

Slow performance first queries on SQL Azure -

Java Entity Manager - JSON reader was expecting a value but found 'db' -