numpy - Delete columns of matrix of CSR format in Python -


i have sparse matrix (22000x97482) in csr format , want delete columns (indices of columns numbers stored in list)

you can use fancy indexing obtain new csr_matrix columns have in list:

all_cols = np.arange(old_m.shape[1]) cols_to_keep = np.where(np.logical_not(np.in1d(all_cols, cols_to_delete)))[0] m = old_m[:, cols_to_keep] 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -