-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: df.add fill_value NotImplementedError #13488
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
Comments
simply I'll mark it, but these things are generally would need outside patches. |
That works for some use cases, but it doesn't work when you want to add two objects with different indices. E.g.: foo = DataFrame([[1, 2, 3], [4, 5, 6]]) If I want to add these two together, I'd like to be able to assume that missing columns in "foo" are 0 values (it's the kind of thing that can happen easily when you're adding new data to old data--in my case, a vocabulary that expands over time), like this: foo.add(bar, axis = 0, fill_value = 0) Yes, I can still do this by reindexing "foo" before calling "add", but that involves more work than a simple "fillna") call. Not only is it a pain, but it prevents me from taking advantage of polymorphism: for example, right now I'm working on an application where the argument of an "add" can be either a DataFrame or a Series, and the app worked fine while the argument was a DataFrame, leaving me with a bug that I discovered only when I accidentally supplied a set of arguments that created a Series. |
take |
Superseded by #32608 so closing |
It appears that
fill_value
option for thedf.add()
method is not actually implemented in the source code. This was brought up in a StackOverflow question.piRSquared is the user that identified it.
The following are all copied from that SO post.
Code Sample, a copy-pastable example if possible
Expected Output
output of
pd.show_versions()
The text was updated successfully, but these errors were encountered: