Skip to content

Numpy tutorial

vanhoan310 edited this page Dec 18, 2018 · 2 revisions

np.linspace(a,b,n)

Compute max and argmax:

a.max(), a.argmax()

Indices

x = np.arange(20).reshape(5, 4)
row, col = np.indices((2, 3))
x[row, col]
array([[0, 1, 2], [4, 5, 6]])

Clone this wiki locally