Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

BUG: axis kw not propogating on pct_change #11150

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 14 commits into from
Closed

BUG: axis kw not propogating on pct_change #11150

wants to merge 14 commits into from

Conversation

Tux1
Copy link
Contributor

@Tux1 Tux1 commented Sep 19, 2015

axis option was not correctly set on fillna in pct_change

axis option was not correctly set on fillna
@sinhrks
Copy link
Member

sinhrks commented Sep 19, 2015

Thanks. Can you add a test for this?

@sinhrks sinhrks added the Numeric Operations Arithmetic, Comparison, and Logical operations label Sep 19, 2015
@jreback jreback changed the title Update generic.py BUG: axis kw not propogating on pct_change Sep 20, 2015
@jreback
Copy link
Contributor

jreback commented Oct 5, 2015

@Tux1 pls add a test for this

@Tux1 Tux1 closed this Oct 5, 2015
@Tux1 Tux1 reopened this Oct 5, 2015
@Tux1
Copy link
Contributor Author

Tux1 commented Oct 5, 2015

Sorry. It is my first commit.
I made a simple test that shows the issue and my commit fixed it.
Is it okay ?
Thanks

@jreback
Copy link
Contributor

jreback commented Oct 5, 2015

pls see the contributing docs: http://pandas.pydata.org/pandas-docs/stable/contributing.html

tests / fix should be on a single pr.

@Tux1
Copy link
Contributor Author

Tux1 commented Oct 5, 2015

Sorry... Moreover the test was wrong.
I have made another test which is passed with my patch. That is committed in a single branch, this one.

@@ -1851,6 +1851,15 @@ def test_pipe_panel(self):
with tm.assertRaises(ValueError):
result = wp.pipe((f, 'y'), x=1, y=1)

def test_pct_change(self):
pnl = DataFrame([np.arange(0, 40, 10), np.arange(0, 40, 10), np.arange(0, 40, 10)]).astype(np.float64)
Copy link
Contributor

Choose a reason for hiding this comment

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

add the issue number here

@jreback
Copy link
Contributor

jreback commented Oct 9, 2015

pls add a whatsnew note for 0.17.1 (bug fix), use this PR number

@jreback jreback added this to the 0.17.1 milestone Oct 9, 2015
@jreback jreback added the Bug label Oct 9, 2015
pnl.iat[1,0] = np.nan
pnl.iat[1,1] = np.nan

expected = pnl.ffill(axis=1).pct_change(axis=1, fill_method=None)
Copy link
Contributor

Choose a reason for hiding this comment

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

test with axis 0, 2 as well (if their are existing tests for that, pls move them here)

further this should be a bit more generic (or append _frame) to the test name as the generic.py tests should test Series,DataFrame,Panel

@jreback
Copy link
Contributor

jreback commented Oct 25, 2015

@Tux1 can you rebase / update

@Tux1
Copy link
Contributor Author

Tux1 commented Oct 26, 2015

Sorry for several commits. I think that is okay now ? whatsnew edited, commit rebased

@@ -96,7 +96,7 @@ Bug Fixes




- Bug in ``DataFrame.pct_change()`` was not propagating axis on fillna method (:issue:`11150`)
Copy link
Contributor

Choose a reason for hiding this comment

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

use double backticks around axis (and say axis keyword) and 'on .fillna() method'

@jreback
Copy link
Contributor

jreback commented Oct 27, 2015

some comments, pls squash when finished

test_pct_change with loop over axis

backtick added
@jreback
Copy link
Contributor

jreback commented Oct 28, 2015

pls rebase on master / squash, see docs here

def test_pct_change_frame(self):
pnl = DataFrame([np.arange(0, 40, 10), np.arange(0, 40, 10), np.arange(0, 40, 10)]).astype(np.float64)
pnl.iat[1,0] = np.nan
pnl.iat[1,1] = np.nan
Copy link
Contributor

Choose a reason for hiding this comment

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

I mean that this function needs to move to tests\test_frame.py (and not in test_generic.py)

@Tux1
Copy link
Contributor Author

Tux1 commented Nov 2, 2015

Sorry, my repo is a mess... I will be better next time

jreback pushed a commit that referenced this pull request Nov 13, 2015
@jreback
Copy link
Contributor

jreback commented Nov 13, 2015

merged via 334b076

thanks!

@jreback jreback closed this Nov 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Numeric Operations Arithmetic, Comparison, and Logical operations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants