-
Notifications
You must be signed in to change notification settings - Fork 118
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
[FEATURE REQUEST] numpy.insert() #463
Comments
@water5 Wouldn't this basically duplicate the functionality of |
But that can't specify where to insert, I consider numpy.append before post this request. |
Obviously, you first have to split your original array into two with slicing (that is, where you specify where you want to insert the values), and then
|
Append is similar
|
On 2D array, a = np.arange(25).reshape(5, 5)
a
b = np.arange(25, 31)
b
np.insert(a, 1, b, axis = 0)
np.insert(a, 1, b, axis = 1)
np.concatenate(a[ : 1], b, a[1 : ])
|
|
Right, that seems could implement most |
You could definitely write a small snippet, if you feel like it. In that case, add the |
https://numpy.org/doc/1.21/reference/generated/numpy.insert.html
The text was updated successfully, but these errors were encountered: