what is best way to shuffle given matrix in Julia (2d-array)?
Function shuffle() does not work.
What I mean is randomly shuffle rows (not all elements).
to shuffle all rows of matrix
a = a[shuffle(1:end), :]
for those who mean to shuffle a specific row,
function shuffle_row(mat, row)
mat[row,:] = shuffle(mat[row,:])
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With