python - Ignore null/blank cells with filter -


i'm trying filter 22nd column numbers between 0.10 , 1.00 day.csv. of cells blank no number @ , cause error:

valueerror: not convert string float:

here tried:

reader = csv.reader(open("alldata.csv"), delimiter=',')      filteredday = filter(lambda p:0.10 <= float(p[23]) <= 1.00, reader)     csv.writer(open(r"{}\day.csv".format(queue),'w',newline =''),                delimiter=',').writerows(filteredday) 

presumably therefore need filter return false when cell in question contains no value? try:

filteredday = filter(lambda p: p[23] != "" ,                                0.10 <= float(p[23]) <= 1.00, reader) 

Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -