[SciPy-User] argsort TypeError
Thu Aug 9 15:25:10 CDT 2012
your problem is interesting, could you pickle the array result, like this
we could play with it?
But I can tell you one thing, I am not comfortable with the way you are
reshaping arrays... Though it may be correct, try using reshape and copy
the result, rather than inplace changing the arrays.
Oleksandr (Sasha) Huziy
2012/8/9 Chris Weisiger <firstname.lastname@example.org>
> I'm trying to find the indices in an array that have the lowest
> values, so that I can plot the corresponding values in another array.
> numpy.argsort would seem to be the proper approach here, but when I
> try it I get this error:
> Traceback (most recent call last):
> File "../scripts/findWorstFitPixel.py", line 48, in <module>
> indices = np.argsort(result)
> line 680, in argsort
> return argsort(axis, kind, order)
> TypeError: an integer is required
> The weird thing is that when I try to replicate the circumstances in
> the REPL (same argument shape/dtype passed to argsort), it succeeds.
> So there must be something subtle going on here. My input is a
> length-270336 1D array of float32s, each of which was generated by
> scipy.stats.pearsonr and almost all of which have values between .95
> and 1. Any ideas what I can investigate to get this working?
> Unfortunately my script relies on reading a bunch of files, so I can't
> very well upload a working sample, but the script itself is here:
> Thanks for any assistance!
> SciPy-User mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-User