-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DOC: 'replace' docstring lacking / too complex #17673
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Comments
reidy-p
added a commit
to reidy-p/pandas
that referenced
this issue
Nov 1, 2017
reidy-p
added a commit
to reidy-p/pandas
that referenced
this issue
Nov 1, 2017
reidy-p
added a commit
to reidy-p/pandas
that referenced
this issue
Nov 2, 2017
should re-evaluate in light of #18100 |
@jorisvandenbossche The latest docs look like they cover all the documentation issues raised in the OP.
opened #33302 for that discussion |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think the
replace
docstring is lacking in many ways (https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.replace.html):to_replace
keyword is both way too complex and lacking an explanation of the simple cases:df.replace(to_replace=0, replace=1)
, it is mentioned in the 'str' explanation, but it is not specific to strings)df.replace({to_replace: replacement})
is not mentioned (the dict explanation starts with explanation of nested dicts)reindex
,asfreq
andfillna
.fillna
is fine, but I fail to see the link with the first two. I would rather add a reference towhere
to replace values based on a boolean condition (and the 'see also' should not just refer to the other methods, but also include a sentence on why / the difference)NDFrame
, and this should never be in a public docstring (failing substituion of docstring ingeneric
)See the tutorial docs (https://pandas.pydata.org/pandas-docs/stable/missing_data.html#replacing-generic-values) with some actual examples.
Underlying reason is that this function of course can do way too many things at the same time (or the same things in too many different ways) ... (orthogonal to this, we could maybe also think if certain functionality could be moved into its own function).
The text was updated successfully, but these errors were encountered: