Skip to content
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

bug: interpolate() row-by-row doesn't work when setting inplace=True #10395

Closed
JianxunLi opened this issue Jun 20, 2015 · 1 comment · Fixed by #10400
Closed

bug: interpolate() row-by-row doesn't work when setting inplace=True #10395

JianxunLi opened this issue Jun 20, 2015 · 1 comment · Fixed by #10400
Labels
Bug Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
Milestone

Comments

@JianxunLi
Copy link

# pandas version 0.16.2
import numpy as np
import pandas as pd

np.random.seed(12345)
# simulate some data
df = pd.DataFrame(np.random.randn(250, 10), columns=np.arange(1, 11), index=pd.date_range('2015-01-01', periods=250, freq='B'))
# set 20% data to NaN
sel = np.random.choice([True, False], size=(250, 10), p=[0.2, 0.8])
df.values[sel] = np.nan

# row-wise interpolation doesn't work when setting inplace=True
df1 = df.copy()
df1.interpolate(method='linear', axis=1, inplace=True)

# inplace doesn't work
import pandas.util.testing as pdt
pdt.assert_frame_equal(df, df1)

# dropping inplace=True, it works
df2 = df.copy()
df2 = df2.interpolate(method='linear', axis=1)
pdt.assert_frame_equal(df, df2)
@jreback
Copy link
Contributor

jreback commented Jun 20, 2015

marking as a bug

@jreback jreback added this to the Next Major Release milestone Jun 20, 2015
@jreback jreback added Bug Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate labels Jun 20, 2015
@jreback jreback modified the milestones: 0.17.0, Next Major Release Jun 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants