[Numpy-discussion] Bug in genfromtxt with usecols and converters
derek at astro.physik.uni-goettingen.de
Wed Aug 27 08:11:32 EDT 2014
On 26 Aug 2014, at 09:05 pm, Adrian Altenhoff <adrian.altenhoff at inf.ethz.ch> wrote:
>> But you are right that the problem with using the first_values, which should of course be valid,
>> somehow stems from the use of usecols, it seems that in that loop
>> for (i, conv) in user_converters.items():
>> i in user_converters and in usecols get out of sync. This certainly looks like a bug, the entire way of
>> modifying i inside the loop appears a bit dangerous to me. I’ll have look if I can make this safer.
>> As long as your data don’t actually contain any missing values you might also simply use np.loadtxt.
> Ok, wasn't aware of that function so far. I will try that!
It was first_values that needs to be addressed by the original indices.
I have created a short test from your case and submitted a fix at
More information about the NumPy-Discussion