Skip to content

Instantly share code, notes, and snippets.

@ryantm
Created January 28, 2022 18:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryantm/290f013f89121dcdd17416dc2e83da07 to your computer and use it in GitHub Desktop.
Save ryantm/290f013f89121dcdd17416dc2e83da07 to your computer and use it in GitHub Desktop.
matrix_zero_default = NMatrix.new(matrix_with_nan.shape, 0.0, stype: :yale)
matrix_with_nan.each_stored_with_indices do |val, i, j|
matrix_zero_default[i,j] = val
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment