Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use DataFrame._from_arrays(..., verify_integrity=False)
  • Loading branch information
rth committed Mar 20, 2020
commit ce6619efd3f38f716810e2c55efa3ba284f641ea
4 changes: 3 additions & 1 deletion pandas/core/arrays/sparse/accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,9 @@ def from_spmatrix(cls, data, index=None, columns=None):
idx = IntIndex(n_rows, indices[sl], check_integrity=False)
arr = SparseArray._simple_new(array_data[sl], idx, dtype)
arrays.append(arr)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, also tried with a generator here to avoid pre-allocating all the arrays, but it doesn't really matter. Most of the remaining run time is in DataFrame._from_arrays.

return DataFrame._from_arrays(arrays, columns=columns, index=index)
return DataFrame._from_arrays(
arrays, columns=columns, index=index, verify_integrity=False
)

def to_dense(self):
"""
Expand Down