pandas 1.4.2

NotesReturns
_values_for_factorize(self) -> 'tuple[np.ndarray, Any]'

Notes

The values returned by this method are also used in pandas.util.hash_pandas_object .

Returns

values : ndarray

An array suitable for factorization. This should maintain order and be a supported dtype (Float64, Int64, UInt64, String, Object). By default, the extension array is cast to object dtype.

na_value : object

The value in :None:None:`values` to consider missing. This will be treated as NA in the factorization routines, so it will be coded as :None:None:`na_sentinel` and not included in uniques . By default, np.nan is used.

Return an array and missing value suitable for factorization.

Examples

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /pandas/core/arrays/base.py#959
type: <class 'function'>
Commit: