Skip to content

DOC: fixing SA01 errors for Index: name, dtype, and equals #58355

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
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 0 additions & 3 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,8 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.Index.drop_duplicates RT03" \
-i "pandas.Index.droplevel RT03,SA01" \
-i "pandas.Index.dropna RT03,SA01" \
-i "pandas.Index.dtype SA01" \
-i "pandas.Index.duplicated RT03" \
-i "pandas.Index.empty GL08" \
-i "pandas.Index.equals SA01" \
-i "pandas.Index.fillna RT03" \
-i "pandas.Index.get_indexer PR07,SA01" \
-i "pandas.Index.get_indexer_for PR01,SA01" \
Expand All @@ -169,7 +167,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.Index.join PR07,RT03,SA01" \
-i "pandas.Index.map SA01" \
-i "pandas.Index.memory_usage RT03" \
-i "pandas.Index.name SA01" \
-i "pandas.Index.names GL08" \
-i "pandas.Index.nbytes SA01" \
-i "pandas.Index.nunique RT03" \
Expand Down
15 changes: 15 additions & 0 deletions pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,10 @@ def dtype(self) -> DtypeObj:
"""
Return the dtype object of the underlying data.

See Also
--------
Index.inferred_type: Return a string of the type inferred from the values.

Examples
--------
>>> idx = pd.Index([1, 2, 3])
Expand Down Expand Up @@ -1638,6 +1642,11 @@ def name(self) -> Hashable:
"""
Return Index or MultiIndex name.

See Also
--------
Index.set_names: Able to set new names partially and by level.
Index.rename: Able to set new names partially and by level.

Examples
--------
>>> idx = pd.Index([1, 2, 3], name="x")
Expand Down Expand Up @@ -5175,6 +5184,12 @@ def equals(self, other: Any) -> bool:
True if "other" is an Index and it has the same elements and order
as the calling index; False otherwise.

See Also
--------
Index.identical: Checks that object attributes and types are also equal.
Index.has_duplicates: Check if the Index has duplicate values.
Index.is_unique: Return if the index has unique values.

Examples
--------
>>> idx1 = pd.Index([1, 2, 3])
Expand Down
Loading