Skip to content

Commit d6a9447

Browse files
committed
Fix pandas.util.hash_pandas_object docstring
- Add parameter description to obj parameter - Correct the Returns section - Change the type line to correctly callout 'Series' type - Update return description to describe the type contained in the Series - Add See Also section Also remove pandas.Timestamp.resolution from code_checks.sh because it is not a function anymore.
1 parent cdc9e95 commit d6a9447

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

ci/code_checks.sh

+1-3
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
7777
-i "pandas.Timedelta.resolution PR02" \
7878
-i "pandas.Timestamp.max PR02" \
7979
-i "pandas.Timestamp.min PR02" \
80-
-i "pandas.Timestamp.resolution PR02" \
8180
-i "pandas.Timestamp.tzinfo GL08" \
8281
-i "pandas.core.groupby.DataFrameGroupBy.plot PR02" \
8382
-i "pandas.core.groupby.SeriesGroupBy.plot PR02" \
@@ -274,8 +273,7 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
274273
-i "pandas.tseries.offsets.YearEnd.is_on_offset GL08" \
275274
-i "pandas.tseries.offsets.YearEnd.month GL08" \
276275
-i "pandas.tseries.offsets.YearEnd.n GL08" \
277-
-i "pandas.tseries.offsets.YearEnd.normalize GL08" \
278-
-i "pandas.util.hash_pandas_object PR07,SA01" # There should be no backslash in the final line, please keep this comment in the last ignored function
276+
-i "pandas.tseries.offsets.YearEnd.normalize GL08" # There should be no backslash in the final line, please keep this comment in the last ignored function
279277

280278
RET=$(($RET + $?)) ; echo $MSG "DONE"
281279

pandas/core/util/hashing.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ def hash_pandas_object(
9494
Parameters
9595
----------
9696
obj : Index, Series, or DataFrame
97+
The input object to hash.
9798
index : bool, default True
9899
Include the index in the hash (if Series/DataFrame).
99100
encoding : str, default 'utf8'
@@ -106,9 +107,14 @@ def hash_pandas_object(
106107
107108
Returns
108109
-------
109-
Series of uint64
110-
Same length as the object.
110+
Series
111+
Containing unsigned integers, same length as object.
111112
113+
See Also
114+
--------
115+
util.hash_tuples : Hash an MultiIndex / listlike-of-tuples efficiently.
116+
util.hash_array : Hash an array.
117+
112118
Examples
113119
--------
114120
>>> pd.util.hash_pandas_object(pd.Series([1, 2, 3]))

0 commit comments

Comments
 (0)