hstack out of memory

狂风中的少年 提交于 2020-05-17 07:42:13

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!