Julia bug using numpy

Hello,

I want to report a bug in julia used with numpy argmax function.

(The numpy.argmax() is a function that returns indices of the max element of the array in a particular axis.)

In the example below np.argmax returns 0 which makes Julia crash.

using PyCall
np = pyimport(“numpy”)
a = [100,2,3,40,5]

println(np.max(a))# print 100
println(a[np.argmax(a)]) # crash

Best regards,

Hi there!

  1. This is intended behavior. Use a[np.argmax(a) + 1] to convert from 0-indexed to 1-index.
  2. Why use numpy? Julia has everything and more…
10 Likes