Closed naitoh closed 5 years ago
> a = Numo::DFloat.new(4,5).seq
=> Numo::DFloat#shape=[4,5]
[[0, 1, 2, 3, 4],
[5, 6, 7, 8, 9],
[10, 11, 12, 13, 14],
[15, 16, 17, 18, 19]]
> a.at([0,1,2],[0,2,3]).inplace - 10
=> Numo::DFloat(view)#shape=[3]
[-10, -3, 3]
> a
=> Numo::DFloat#shape=[4,5]
[[-10, 1, 2, 3, 4],
[5, 6, -3, 8, 9],
[10, 11, 12, 3, 14],
[15, 16, 17, 18, 19]]
Thank you for your reply! In this way, I can do what I want to do.
How to access in coordinates like numpy?
numpy (Examples of expected results.)
In Numpy, coordinate access can be done by giving an x, y coordinate array (or ndarray) as an argument.
Numo::NArray (Examples of unexpected results.)
If Numo::NArray is written in the same way as numpy, it will be the row / column unit specification. That is not the result I want.
Numo::NArray (Examples of expected results.)
I got the same result as numpy, but the calculation of coordinates is complicated.
Can you easily specify multiple coordinate specifications?