Remove empty and non numeric from list #python #list #numeric #filtering
# check a list for float type value
def checkListFloat(self, arList, isfloat = False) :
result = []
for _i in arList:
if self.checkFLoat(_i) :
result.append([int(float(_i))])
else :
res = re.sub('[^\d\.,]', '', _i)
if res :
result.append([res])
return result
# check float
def checkFLoat(self, value) :
try :
return float(value).is_integer()
except ValueError:
return False