We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In python's numpy, you can substitute by specifying the indices of the x and y axes.
import numpy as np a = np.arange(9).reshape(3,3) x = [0, 1, 2] y = [2, 0, 1] c = [1000, 1001, 1002] a[x, y] = c a # array([[ 0, 1, 1000], # [1001, 4, 5], # [ 6, 1002, 8]])
The same thing is not possible in Ruby. What should I do?
a = Numo::Int32.new(3,3).seq # [[0, 1, 2], # [3, 0, 5], # [6, 7, 0]] x = [0, 1, 2] y = [2, 0, 1] c = [1000, 1001, 1002] a[x, y] = c # Numo::Int32#shape=[3,3] # [[0, 0, 1000], # [0, 0, 1001], # [0, 0, 1002]]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
In python's numpy, you can substitute by specifying the indices of the x and y axes.
The same thing is not possible in Ruby.
What should I do?
The text was updated successfully, but these errors were encountered: