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
Add Series.map #389
Add Series.map #389
Conversation
See Also | ||
-------- | ||
Series.apply : For applying more complex functions on a Series. | ||
DataFrame.applymap : Apply a function elementwise on a whole DataFrame. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will add this one soon.
Codecov Report
@@ Coverage Diff @@
## master #389 +/- ##
==========================================
+ Coverage 94.75% 94.77% +0.02%
==========================================
Files 42 42
Lines 4554 4577 +23
==========================================
+ Hits 4315 4338 +23
Misses 239 239
Continue to review full report at Codecov.
|
49a44e0
to
379b665
Compare
86b8b6e
to
a707fd0
Compare
|
||
if hasattr(arg, "__missing__"): | ||
tmp_val = arg[np._NoValue] | ||
del arg[np._NoValue] # Remove in case it's set in defaultdict. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a hack to mimic Pandas's behaviour with defaultdict... but I believe basically the behaviours are matched when the input is a dictionary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super cool! My only concern is that you are mutating 'arg', but this strikes me as an edge case for now.
Softagram Impact Report for pull/389 (head commit: 512365e)⭐ Change Overview
📄 Full report
Give feedback on this report to support@softagram.com |
This PR adds
Series.map
. If the function is given as an argument, seems we can just reuseapply
.