Description
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
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.reset_index.html
Documentation problem
In the description of the names
parameter, the declared type in bold is correct: "int, str or 1-dimensional list, default None"
But the expanded description that immediately follows incorrectly states that names
can be a tuple: "If the DataFrame has a MultiIndex, this has to be a list or tuple with length equal to the number of levels."
This is incorrect because passing a tuple as the names
parameter raises this error: 'raise ValueError("Index names must be str or 1-dimensional list")'
Suggested fix for documentation
Remove " or tuple" from the expanded documentation description. This will cause it to match the bold-face type description, and more importantly accurately reflect the behavior. I can submit a PR for this if that's preferred.