-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: fix return type of str.extract #22562
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
DOC: fix return type of str.extract #22562
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great changes. Adding some things that could be improved in the original docstring.
pandas/core/strings.py
Outdated
expression pat will be used for column names; otherwise | ||
capture group numbers will be used. The dtype of each result | ||
column is always object, even when no match is found. If | ||
expand=False and pat has only one capture group, then return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add double backticks around expand=False
? (i.e. ``expand=True``)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
pandas/core/strings.py
Outdated
column is always object, even when no match is found. If | ||
expand=False and pat has only one capture group, then return | ||
a Series (if subject is a Series) or Index (if subject is an | ||
Index). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
according to this, it can also return a Series
or Index
, do you mind adding it to the type? So, instead of DataFrame
it's DataFrame, Series or Index
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
I addressed the above three issues in one commit. Hopefully it works. Next time, I suppose I should separate them.
pandas/core/strings.py
Outdated
``re`` module flags, e.g. ``re.IGNORECASE``. | ||
See :mod:`re` | ||
One of the ``re`` module flags, e.g. ``re.IGNORECASE``. | ||
See :mod:`re`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mind briefly explaining what these flags are about. Nothing long, but something a bit more descriptive than what we've got now just linking to the re
documentation. Something like "Flags that modify regular expression matching for things like case, spaces, etc."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
Codecov Report
@@ Coverage Diff @@
## master #22562 +/- ##
=======================================
Coverage 92.04% 92.04%
=======================================
Files 169 169
Lines 50787 50787
=======================================
Hits 46745 46745
Misses 4042 4042
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Thanks for the changes @zhujun98 No need to address the comments in a PR in separate commits, that's rarely done. Feel free to fix all them in a single commit, unless separating them adds value to you. Can you merge master in your branch and push it, so the CI runs again, and hopefully this time all is green please. |
Thanks for the explanation @datapythonista I am a little bit confused about the next step. To trigger the CI again, do you mean 'git merge upstream/master' or 'git rebase upstream/master'? By the way, I checked other PRs (e.g. #22571) and it seems there is some issue with Anaconda now. |
Anaconda is back to normal, so I restarted all of your failed builds. In terms of re-triggering builds, you have two options:
|
Thank you for the information @gfyoung! Finally we got all the green lights @datapythonista! Thank you very much for guiding me through the whole workflow of contributing to Pandas docstrings! I really enjoyed it |
Another option to what @gfyoung said is Changes lgtm, but will let someone else merge it, so we have an extra pair of eyes on the changes. |
git diff upstream/master -u -- "*.py" | flake8 --diff