问题
I got scipy.sparse.csr_matrix
object wich size is full_sites_sparse.shape
(336358, 48371)
. Also I have dataframe wich size is union_df[hour].shape
(336358, 17)
. I want to union there and get another one with size (336358, 48388)
I try union there with:
full_sites_hour_sparse = np.hstack((full_sites_sparse.A, union_df[hour].values))
and
full_sites_hour_sparse = scipy.sparse.hstack(full_sites_sparse.A, union_df[hour].values)
But both raise out of memory exception. Any other way to do this?
来源:https://stackoverflow.com/questions/61393406/hstack-out-of-memory