Skip to content

Changed kind parameter from integer to int, Added example #32361

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 29, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion pandas/core/arrays/sparse/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ class SparseArray(PandasObject, ExtensionArray, ExtensionOpsMixin):
3. ``data.dtype.fill_value`` if `fill_value` is None and `dtype`
is not a ``SparseDtype`` and `data` is a ``SparseArray``.

kind : {'integer', 'block'}, default 'integer'
kind : {'int', 'block'}, default 'int'
Copy link
Member

Choose a reason for hiding this comment

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

Please revert this line

Copy link
Contributor Author

@zakybilfagih zakybilfagih Feb 29, 2020

Choose a reason for hiding this comment

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

Hey, thanks for the reply :)
After reverting the line, an error pops up on the validate_doctring.py test, is that ok?
@MomIsBestFriend

################################################################################
################################## Validation ##################################
################################################################################

4 Errors found:
        Parameter "sparse_index" has no description
        Parameter "index" has no description
        **Parameter "kind" type should use "int" instead of "integer"**
        See Also section not found

Copy link
Member

Choose a reason for hiding this comment

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

This is a known bug with the validator (see #25205) so just have to ignore for now

The type of storage for sparse locations.

* 'block': Stores a `block` and `block_length` for each
Expand All @@ -255,6 +255,16 @@ class SparseArray(PandasObject, ExtensionArray, ExtensionOpsMixin):
Methods
-------
None

Examples
--------
>>> from pandas.arrays import SparseArray
>>> arr = SparseArray([0, 0, 1, 2])
>>> arr
[0, 0, 1, 2]
Fill: 0
IntIndex
Indices: array([2, 3], dtype=int32)
"""

_pandas_ftype = "sparse"
Expand Down