20.01.2020 9:10, Ben Gorte:
v i } 1$.3 4;0 1;0 NB. amend an 'empty' sparse matrix
|index error
|   v     i}1$.3 4;0 1;0

Amend working for 1-dimensional sparse arrays

   y =. 0 0 0 5 0 0 0 9
   ] u =. $. y
   u
3 │ 5
7 │ 9

   5 (1)} u
1 │ 5
3 │ 5
7 │ 9

For two dimensional is possible amend only whole row.
   (1 2 3 4) (0) } 1$.3 4;0 1;0
0 0 │ 1
0 1 │ 2
0 2 │ 3
0 3 │ 4

Sergey.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to