BUG: axis kw not propogating on pct_change by Tux1 · Pull Request #11150 · pandas-dev/pandas (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation20 Commits14 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

Tux1

axis option was not correctly set on fillna in pct_change

@Tux1

axis option was not correctly set on fillna

@sinhrks

Thanks. Can you add a test for this?

@jreback jreback changed the titleUpdate generic.py BUG: axis kw not propogating on pct_change

Sep 20, 2015

@jreback

@Tux1 pls add a test for this

@Tux1

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

@Tux1

@Tux1

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.

jreback

@@ -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)

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

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

jreback

pnl.iat[1,0] = np.nan
pnl.iat[1,1] = np.nan
expected = pnl.ffill(axis=1).pct_change(axis=1, fill_method=None)

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

@Tux1 can you rebase / update

Tux1 and others added 5 commits

October 26, 2015 21:52

@Tux1

@Tux1

test regarding buf fix on pct_change propagation axis

revamping test_pct_change. Rename, multi axis and error fixed

@Tux1

@Tux1

@Tux1

@Tux1

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

jreback

@@ -96,7 +96,7 @@ Bug Fixes
- Bug in ``DataFrame.pct_change()`` was not propagating axis on fillna method (:issue:`11150`)

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

some comments, pls squash when finished

@Tux1

test_pct_change with loop over axis

backtick added

@cfperez @Tux1

@rekcahpassyla @Tux1

Add an optional argument to _NDFrameIndexer._align_series to indicate if the indexer is from a MultiIndex

@jreback @Tux1

@jreback @Tux1

@Tux1

@jreback

pls rebase on master / squash, see docs here

jreback

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

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

@Tux1

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

jreback pushed a commit that referenced this pull request

Nov 13, 2015

@Tux1 @jreback

@jreback