问题
I have the following python3 code that doesn't seem to complete. Is there an estimate for how long this takes? I would like to be able to use sparsedataframes because a large number of the elements are 0 value.
>>> s_matrix <12000x61190 sparse matrix of type '<class 'numpy.float32'>' with 1577553 stored elements in Compressed Sparse Row format> >>> sdf = pd.SparseDataFrame(s_matrix)
This has been running for hours and still hasn't completed. Similarly, I was able to load the 1.3GB data set into a dataframe, but the sdf = df.to_sparse() never completed and I ended up aborting the run.
Any help for speeding up the conversion to SparseDataFrame would be appreciated.
来源:https://stackoverflow.com/questions/46750202/how-come-pandas-pd-sparsedataframe-never-completes-for-large-data-sets