NumPy genfromtxt: using filling_missing correctly NumPy genfromtxt: using filling_missing correctly numpy numpy

NumPy genfromtxt: using filling_missing correctly


It's not obvious from the documentation, but filling_values="0" works.

In [19]: !cat test.txta,b,c,d1,2,3,45,,7,89,10,,12In [20]: a = numpy.genfromtxt('test.txt', delimiter=',', names=True, filling_values="0")In [21]: print a[(1.0, 2.0, 3.0, 4.0) (5.0, 0.0, 7.0, 8.0) (9.0, 10.0, 0.0, 12.0)]