-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
comparison_with_sql document: adding a calculated column #28162
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
Comments
I would write this as tips.assign(
tip_rate = tips['tip'] / tips['total_bill']
) are you interested in adding this example @DavidRosen? |
@TomAugspurger, I'm a novice and really don't know what's involved in adding to the docs. |
Dev guide is at https://dev.pandas.io/development/contributing.html#
… On Aug 26, 2019, at 22:23, DavidRosen ***@***.***> wrote:
are you interested in adding this example @DavidRosen?
@TomAugspurger, I'm a novice and really don't know what's involved in adding to the docs.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Come to think of it, why do we even need .assign() ? How about just:
BTW, this also has the advantage that the linter won't prohibit spaces around the "=" as it did when we used .assign() (because "=" was for a keyword argument). |
Hi @TomAugspurger, I just referenced this issue in a PR a while ago. I'm relatively new to contributing to open source projects, so I'd like you to review if this is what was proposed in this Issue. Best, Lucas |
Hi @lucassa3. I think David submitted a PR but didn’t reference the issue. So we won’t need your PR for this issue. It looks like you made your PR against your master branch. In the future you should target pandas’ master branch. Let us know if you need help finding another issue. |
Yes, I accidentally forgot to change merge target when opening the PR. I'll check other issues around, but thanks for the feedback Tom! |
Closed by #28182. |
Uh oh!
There was an error while loading. Please reload this page.
https://pandas-docs.github.io/pandas-docs-travis/getting_started/comparison/comparison_with_sql.html
In section "SELECT", the important use case of adding a calculated column is omitted.
I suggest adding something like the following:
select *, tip/total_bill as tip_rate from tips
pd.concat([tips, pd.Series(tips.tip/tips.total_bill, name='tip_rate')], axis=1)
The text was updated successfully, but these errors were encountered: