I have a numPy sparse matrix saved as .npz file, which I want to load into R. This is what I tried:
library(reticulate)
np <- import("numpy")
npz_train <- np$load('netflix_matrix.npz')
df <- npz_train$f[["data"]]
The df length is 103327692, but for
npz_train_imgs$f[["shape"]]
[1] 17770 2649429
which is a total diffrent size from 103327692. I know it is a sparse matrix, so how can I read it as one? I would like to have NAs in the blanks.
Thank you!