Comments (7)
as in, remove it from interpolate
. if any intermediate function (which is also used in other places) requires inplace
, just pass inplace=False
from pandas.
@Dr-Irv Thank you for reporting this problem! I am able to reproduce this. The problem is purely related to the inplace=True
option. The interpolation result here becomes None
and internally the _update_inplace
method call here does not yet possess the final result. There is still the step of index correction missing, which is only applied afterwards here.
The problem is that the context in pandas.core.generic.NDFrame.interpolate
does not know about the correct final index. So far, I am unable to figure out how I can update the state of the parent data frame that led to the pandas.core.resample.Resampler.interpolate
call. I tried to manipulate self._selected_obj
but it does not propagate. If somebody can point me at the object that needs to be updated I can easily fix this.
from pandas.
I could use some input here @MarcoGorelli. As we are introducing a breaking change anyway, we could think about removing the inplace
option. I think it is counter-intuitive that the second method in a chain of methods modifies the original data frame "in place". Just think about the completely valid option to split the calls like this:
df = ...
resampler = df.resample("ME") # creates a resampler instance, does not modify df
resampler.interpolate(inplace=True) # modifies df, returns None
from pandas.
we could think about removing the inplace option.
yup - this looks like one of the places where inplace
was a lie anyway? Agree, "in for a penny, in for a pound" - if we gonna break, let's break. It's for the better anyway
from pandas.
@MarcoGorelli 🙌 I'll take care of it and ping you in the PR.
from pandas.
@MarcoGorelli I looked into this but it is extremely convoluted 😢 The inplace
option is passed on in multiple steps, partially to overloaded methods or abstract methods with many implementations. There are dozens of tests that use inplace=True
or even test this in particular.
Before I spend a lot of time on this, could you indicate a safe way to approach it? Shall I really drop the inplace
argument in all those methods, delete all the tests against the feature and switch to not-inplace in the tests that use it?
from pandas.
yeah i'd be ok with that
from pandas.
Related Issues (20)
- Make specific pandas dataframe column immuteable / not changeable HOT 4
- BUG: df.drop_duplicates fails if there is only a single row HOT 3
- Potential regression with PR "PERF: Eliminate circular references in accessor attributes (#58733)" HOT 1
- ENH: support parquet's enum type using Categorical when (de)serializing HOT 3
- ENH: generalize `__init__` on a `dict` to `abc.collections.Mapping` and `__getitem__` on a `list` to `abc.collections.Sequence` HOT 10
- ENH: Add a Series method which checks whether a Series is constant HOT 2
- BUG: df.agg with pd.NamedAgg axis=1 unsupported, but errors differently depending on contents of index HOT 1
- BUG: Segmentation Fault when importing Pandas in python 3.10.14 HOT 3
- BUG: df.agg with df with missing values results in IndexError HOT 3
- BUG: Groupby transformation (cumsum) output dtype depends on whether NA is among group labels HOT 7
- DOC: Docstrings missing from .py files in Sphinxext docs folder HOT 7
- BUG: Lookup by datetime in timestamp index does not work HOT 1
- DOC: Insufficient Project Background Information HOT 2
- BUG: pd.Index.Intersection fails with multiple data frames HOT 3
- BUG: pd.concat fails with large index values when using ArrowDtype
- BUG: Importing Pandas takes 30 seconds HOT 1
- DOC: Enhance the docstrings to provide more detailed explanations for the functions and their parameters in Common.py HOT 3
- Reduce redundancy: Common.py HOT 1
- ENH: add `atol`, `rtol` and `check_exact` to the Object.compare() method HOT 1
- BUG: Warning when compiling pandas/_libs/algos.c
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pandas.