Re: [Numpy-discussion] ndrange, like range but multidimensiontal

2018-10-07 Thread Allan Haldane
On 10/07/2018 10:32 AM, Mark Harfouche wrote: With `np.ndrange` it can look something like this: ``` c = np.empty((4, 4), dtype=object) # ... compute on c for i in np.ndrange(c.shape)[:, 1:-1]:     c[i] # = some operation on c[i] that depends on the index i ``` very pythonic, very familiar to

[Numpy-discussion] ndrange, like range but multidimensiontal

2018-10-07 Thread Mark Harfouche
Hi All, I've been using numpy array objects to store collections of 2D (and soon ND) variables. When iterating through these collections, I often found it useful to use `ndindex`, which for `for loops` behaves much like `range` with only a `stop` parameter. That said, it lacks a few features

Re: [Numpy-discussion] Adding a hex version like PY_VERSION_HEX

2018-10-07 Thread Matti Picus
On 05/10/18 11:46, Jerome Kieffer wrote: On Fri, 5 Oct 2018 11:31:20 +0300 Matti Picus wrote: In PR 12074 https://github.com/numpy/numpy/pull/12074 I propose adding a function `version.get_numpy_version_as_hex()` which returns a hex value to represent the current NumPy version