Skip to content

DOC: don't suggest melt instead of lookup #45589

Closed
@MarcoGorelli

Description

@MarcoGorelli

Pandas version checks

  • I have checked that the issue still exists on the latest versions of the docs on main here

Location of the documentation

pandas/pandas/core/frame.py

Lines 4562 to 4566 in 12475e0

.. deprecated:: 1.2.0
DataFrame.lookup is deprecated,
use DataFrame.melt and DataFrame.loc instead.
For further details see
:ref:`Looking up values by index/column labels <indexing.lookup>`.

Documentation problem

It suggested to use loc and melt. However, the example from https://pandas.pydata.org/docs/user_guide/indexing.html#indexing-lookup suggests to instead use factorize and NumPy indexing.

This a lot faster, so that should be suggested instead

Suggested fix for documentation

Suggest to use factorize and NumPy indexing, rather than loc and melt

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions