Skip to content

Commit

Permalink
DOC: Add the description of make_sparse mask generation routine
Browse files Browse the repository at this point in the history
  • Loading branch information
Licht-T committed Sep 24, 2017
1 parent 32d10b0 commit 08f5a22
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pandas/core/sparse/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,9 @@ def make_sparse(arr, kind='block', fill_value=None):
arr = arr.astype(object)

if is_object_dtype(arr.dtype):
# element-wise equality check method in numpy doesn't treat
# each element type, eg. 0, 0.0, and False are treated as
# same. So we have to check the both of its type and value.
mask = np.ones(len(arr), dtype=np.bool)
fv_type = type(fill_value)

Expand Down

0 comments on commit 08f5a22

Please sign in to comment.