Skip to content

... #25315

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

Closed
wants to merge 3 commits into from
Closed

... #25315

wants to merge 3 commits into from

Conversation

xieyuheng
Copy link

@xieyuheng xieyuheng commented Feb 14, 2019

...

@WillAyd
Copy link
Member

WillAyd commented Feb 14, 2019

Please add test(s) as they should always come first

if ddof == 1:
try:
return self._cython_agg_general('std', **kwargs)
except Exception:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not entirely clear what this is for but except for legacy code we never catch just base Exception so will need something more explicit

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy / paste isn't the right way to go here. Can you still keep the dispatch to self.var and just see what is mangling the expression once passed as an argument to np.sqrt instead?

@codecov
Copy link

codecov bot commented Feb 14, 2019

Codecov Report

Merging #25315 into master will decrease coverage by 50%.
The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master   #25315       +/-   ##
===========================================
- Coverage   91.72%   41.72%   -50.01%     
===========================================
  Files         173      173               
  Lines       52831    52840        +9     
===========================================
- Hits        48457    22045    -26412     
- Misses       4374    30795    +26421
Flag Coverage Δ
#multiple ?
#single 41.72% <0%> (-0.01%) ⬇️
Impacted Files Coverage Δ
pandas/core/groupby/groupby.py 24.17% <0%> (-72.63%) ⬇️
pandas/io/formats/latex.py 0% <0%> (-100%) ⬇️
pandas/core/categorical.py 0% <0%> (-100%) ⬇️
pandas/io/sas/sas_constants.py 0% <0%> (-100%) ⬇️
pandas/tseries/plotting.py 0% <0%> (-100%) ⬇️
pandas/tseries/converter.py 0% <0%> (-100%) ⬇️
pandas/io/formats/html.py 0% <0%> (-99.35%) ⬇️
pandas/core/groupby/categorical.py 0% <0%> (-95.46%) ⬇️
pandas/io/sas/sas7bdat.py 0% <0%> (-91.17%) ⬇️
pandas/io/sas/sas_xport.py 0% <0%> (-90.15%) ⬇️
... and 130 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6a8e708...89d39f1. Read the comment docs.

# 1 b B 1.414214

assert_series_equal(
np.sqrt(group_var["X"]),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless there is a reason for using np.sqrt here just explicitly construct the expected values in a variable called expected. Also do result = on the groupby op you are testing and simply make this line assert_series_equal(result, expected) (should see this usage throughout tests if unclear from this comment)

if ddof == 1:
try:
return self._cython_agg_general('std', **kwargs)
except Exception:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy / paste isn't the right way to go here. Can you still keep the dispatch to self.var and just see what is mangling the expression once passed as an argument to np.sqrt instead?

@xieyuheng xieyuheng closed this Feb 15, 2019
@jreback
Copy link
Contributor

jreback commented Feb 15, 2019

@xieyuheng

@WillAyd comments here are typical comments for a PR; we require certain a specific style for code and tests as well as maintainable code; catching generic exceptions does not help. if you would like to update pls do so.

@xieyuheng xieyuheng changed the title FIX: apply std to groupby with as_index=False ... Feb 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants