Skip to content

Commit 08f5a22

Browse files
committed
DOC: Add the description of make_sparse mask generation routine
1 parent 32d10b0 commit 08f5a22

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pandas/core/sparse/array.py

+3
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,9 @@ def make_sparse(arr, kind='block', fill_value=None):
791791
arr = arr.astype(object)
792792

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

0 commit comments

Comments
 (0)