I am having a random (Y) list with (X) elements (seed elements in 2nd dimension) where I want to reset values on a random factor (Z) that is between 0f and 1f. For numerical lists this code works fine
q)seed:20
q){(0>z-(x#seed)?\:1f)*(x#seed)?\:y}[3;10;0.25]
How can I extend that code to be running also in the case of symbols (or char lists) like that
q){(0>z-(x#seed)?\:1f)*(x#seed)?\:y}[3;`8;0.25]
q){(0>z-(x#seed)?\:1f)*(x#seed)?\:y}[3;" ";0.25]
I guess the multiplication in the middle is the problem, but I dont know how to make it more generic.
Maybe there is even a more elegant solution to this problem than creating 2 lists and handling it like that.
Thanks
Aucun commentaire:
Enregistrer un commentaire