Jozsef Meszaros
Mar 23, 2023

--

Very nice list! One more that I would recommend is using _like when making copies of existing arrays, e.g.

Given an existing ndarray A, say you need to create another ndarray of the same shape and type, B, and fill each entry with a zero:

B = np.zeros_like( A )

Also possible: np.ones_like( A ), np.empty_like( A )

Lots of saved keystrokes

--

--

Jozsef Meszaros
Jozsef Meszaros

No responses yet