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

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

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

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -