I have a list:
{{pos_1,val_1},{pos_2,val_2},...}
and would like to generate an array of dimension d
, with values val_i
at positionspos_i
, the rest being filled with 0
. I would assume that I shall use SparseArray
but this function has a different form of argument:
{pos_1->val_1,pos_2->val_2,...}
Is there any simple way to transform one type of the argument into the other, or completely different approach shall be undertaken?