pandas-dev / pandas

Flexible and powerful data analysis / manipulation library for Python, providing labeled data structures similar to R data.frame objects, statistical functions, and much more
https://pandas.pydata.org
BSD 3-Clause "New" or "Revised" License
43.4k stars 17.83k forks source link

DOC: the source link of CategoricalIndex's methods are wrong. #36858

Open junjunjunk opened 3 years ago

junjunjunk commented 3 years ago

Location of the documentation

For example, in pandas.CategoricalIndex.add_categories, the source link jumps to the following source.This link is wrong. As far as I've observed, the above methods all jump to the same wrong link. https://github.com/pandas-dev/pandas/blob/40b2aa56c3779d0178069e8182dcc3bcdc102e57/pandas/core/accessor.py#L98-L99

The source link should jump to the following location. https://github.com/pandas-dev/pandas/blob/40daf00721f358105f744e8aad7b0c524d1c417b/pandas/core/arrays/categorical.py#L943

Suggested fix for documentation

Correct the source link.

junjunjunk commented 3 years ago

take

aflah02 commented 3 years ago

@junjunjunk is this issue open to do?

junjunjunk commented 3 years ago

@aflah02 This issue is open. No one is assigned, so it's okay to take this issue.

aflah02 commented 3 years ago

Okk I'll try it then thanks 👍

aflah02 commented 3 years ago

@junjunjunk I have been trying to look at how redirects are made but couldn't find anything. Like in the browser page there is a source link which upon clicking redirects you however in the documentation at the current linked code there is nothing to indicate that it has been linked https://github.com/pandas-dev/pandas/blob/54682234e3a3e89e246313bf8f9a53f98b199e7b/pandas/core/accessor.py#L91-L92 Any idea on how links are actually taken care of in the Documentation?