Numpy.NET icon indicating copy to clipboard operation
Numpy.NET copied to clipboard

Trouble Translating Slicer syntax from Python

Open ScottSSapphire opened this issue 11 months ago • 1 comments

Hi,

I'm really new to using the library and I'm having trouble translating the slicer syntax in the below python source to Numpy.NET.

Please let me know if there is a more appropriate place to ask such questions.

    b = np.hstack((a,a[:,(a.shape[1]-2)::-1]))
    c = np.hstack((b,b[:,(b.shape[1]-2):0:-1]))

Thanks

ScottSSapphire avatar Apr 29 '25 16:04 ScottSSapphire

I think you need to do it like this:

a[$":,{a.shape[1]-2}::-1"]

Let me know if that doesn't work and provide a simple example with python code for reproduction.

henon avatar Apr 29 '25 16:04 henon