Skip to content

ENH + BUG: insert of new values for axis parameter on pandas.DataFrame.quantile #9544

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 4 commits into from

Conversation

fbrundu
Copy link
Contributor

@fbrundu fbrundu commented Feb 24, 2015

closes #9543

I added the values "index" and "columns" for the axis parameter of the method pandas.DataFrame.quantile().
Also, there was no check on the value inserted for axis. E.g. if 2 or "foo" was inserted, no ValueError() was raised.
I added a basic check.

Thanks

@jreback
Copy link
Contributor

jreback commented Feb 24, 2015

you don't need all this.

axis = self._get_axis_number(axis) will suffice

mainly need to add a test

@fbrundu
Copy link
Contributor Author

fbrundu commented Feb 24, 2015

You are right. I am correcting it.
Thanks

@fbrundu
Copy link
Contributor Author

fbrundu commented Feb 24, 2015

I corrected it and I implemented a basic test. In case tell me if I did any mistake.
Thanks

@jreback jreback added this to the 0.16.0 milestone Feb 24, 2015
axis : {0, 1}
0 for row-wise, 1 for column-wise
axis : {0, 1, 'index', 'columns'} (default 0)
0 or 'index' a quantile for each column, 1 or 'columns' a
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is as clear as the 0 for row-wise, .... What about 0 or 'index' for row-wise, ...?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi Kevin,
I think you are right. I found it more clear defining exactly what the result will be (because I found that non-native english speakers often struggle to understand the meaning of -wise: see http://forum.wordreference.com/showthread.php?t=403654 ). But I think that your observation is correct.

@jreback jreback modified the milestones: 0.16.0, Next Major Release Mar 5, 2015
@fbrundu
Copy link
Contributor Author

fbrundu commented Mar 27, 2015

I finally had the time to complete my PR with the Travis CI build. Now what have I to do? (it is my first PR)

@@ -11786,6 +11786,30 @@ def test_quantile(self):
expected = Series([3., 4.], index=[0, 1])
assert_series_equal(result, expected)

def test_quantile_axis_parameter(self):
from numpy import percentile
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add the issue number here

@jreback
Copy link
Contributor

jreback commented May 29, 2015

this looks fine. can you add a release note for 0.17.0 in the API section? ping when travis is green.

@jreback jreback modified the milestones: 0.17.0, Next Major Release May 29, 2015
@fbrundu
Copy link
Contributor Author

fbrundu commented Jun 5, 2015

Hi @jreback
Have I to modify this file: https://github.com/pydata/pandas/blob/master/doc/source/release.rst
?
Second, when you say "can you add the issue number here" (see comment above) it means I should write something like:

# Unit test for #9544

Thanks

@shoyer
Copy link
Member

shoyer commented Jun 5, 2015

@fbrundu this the file to which to add release notes: https://github.com/pydata/pandas/blob/master/doc/source/whatsnew/v0.16.2.txt

(we're actually going to release 0.16.2 before 0.17, and this can go in there)

As for the issue number, yes that would be fine. Something as simple as # GH9544 would be enough.

@fbrundu
Copy link
Contributor Author

fbrundu commented Jun 7, 2015

@jreback travis is green but git tells me merge conflicts
let me know

@jreback
Copy link
Contributor

jreback commented Jun 7, 2015

merged via c0917de

thanks!

@jreback jreback closed this Jun 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

String value for DataFrame.quantile() axis parameter
4 participants