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 26, 2017
1 parent 8e01026 commit a48f957
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 a48f957

Please sign in to comment.