Skip to content

Trouble Translating Slicer syntax from Python #133

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ScottSSapphire opened this issue Apr 29, 2025 · 1 comment
Open

Trouble Translating Slicer syntax from Python #133

ScottSSapphire opened this issue Apr 29, 2025 · 1 comment

Comments

@ScottSSapphire
Copy link

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

@henon
Copy link
Contributor

henon commented Apr 29, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants