Skip to content
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

Return an mlx array excluding a set of columns and rows similar to np.delete #1552

Open
kyrollosyanny opened this issue Nov 2, 2024 · 0 comments

Comments

@kyrollosyanny
Copy link

kyrollosyanny commented Nov 2, 2024

Describe the bug
Would it be possible given an array A, bad row indices and bad column indices to make a new array that does not have these rows or columns similar to np.delete? But also hoping for it to be efficient

This can be done with np.delete as follows:

To Reproduce

import numpy as np
A=np.random.rand(20,16)
bad_col=np.arange(0,A.shape[1],4)[1:]
bad_row=np.arange(0,A.shape[0],4)[1:]
Anew=np.delete(np.delete(A,bad_row,0),bad_col,1)
print('old shape ',A.shape)
print('new shape ',Anew.shape)

Thank you

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

1 participant