pandas.util.hash_pandas_object

pandas 3.1.1 · General functions · function

Compute element-wise hashes, optionally incorporating the pandas object's index.

Call syntax

pd.util.hash_pandas_object(
    obj,
    index=True,
    encoding='utf8',
    hash_key='0123456789123456',
    categorize=True,
)

Run the example

Edit the example and select Run Python to see the result.

Parameters

ParameterRequirementAccepted values and behavior
obj Required
Positional or keyword
Index, Series, or DataFrame

Provide the pandas object, scalar, or array-like input described in the accepted values.

index Optional
Positional or keyword
Default True
bool

Supply row labels or control how existing row labels are used.

encoding Optional
Positional or keyword
Default 'utf8'
str

Name a text encoding such as "utf-8".

hash_key Optional
Positional or keyword
Default '0123456789123456'
str
categorize Optional
Positional or keyword
Default True
bool

Returns

Series of uint64