I got this after using this code:
array1 = numpy.empty((0,4),int)
for a,b,c,d in something:
array1 = numpy.vstack([array1,[a,b,c,d]])
I am not sure why I am getting empty arrays. Is there a way to remove them?
I got this after using this code:
array1 = numpy.empty((0,4),int)
for a,b,c,d in something:
array1 = numpy.vstack([array1,[a,b,c,d]])
I am not sure why I am getting empty arrays. Is there a way to remove them?
L = [[], [1, 4]]
C = filter(lambda x: x!=[], L)
print(C)
OUT:
[[4,2]]
ALTERNATIVE:
C = filter(lambda x: len(x) > 0, L)
print(C)
OUT:
[[4,2]]