-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: #12815 Always use np.nan for missing values of object dtypes #18313
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #18313 +/- ##
==========================================
- Coverage 91.39% 91.37% -0.02%
==========================================
Files 164 164
Lines 49854 49855 +1
==========================================
- Hits 45566 45557 -9
- Misses 4288 4298 +10
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #18313 +/- ##
==========================================
- Coverage 91.38% 91.36% -0.02%
==========================================
Files 164 164
Lines 49796 49798 +2
==========================================
- Hits 45507 45500 -7
- Misses 4289 4298 +9
Continue to review full report at Codecov.
|
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.
lgtm. pls add a note in 0.22 / other api changes.
pandas/tests/frame/test_reshape.py
Outdated
|
||
|
||
def test_unstack_fill_frame_object(): | ||
# Test unstacking with object |
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.
add the issue number as a comment
@jreback Changes made. |
trivial change. push & ping when green. |
doc/source/whatsnew/v0.22.0.txt
Outdated
@@ -48,6 +48,7 @@ Other API Changes | |||
- :class:`CacheableOffset` and :class:`WeekDay` are no longer available in the ``pandas.tseries.offsets`` module (:issue:`17830`) | |||
- `tseries.frequencies.get_freq_group()` and `tseries.frequencies.DAYS` are removed from the public API (:issue:`18034`) | |||
- :func:`Series.truncate` and :func:`DataFrame.truncate` will raise a ``ValueError`` if the index is not sorted instead of an unhelpful ``KeyError`` (:issue:`17935`) | |||
- `Dataframe.unstack()` will now default to filling with `np.nan` for ``object`` columns. (:issue:`12815`) |
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.
use double-backticks around np.nan
note if you are interested in cleaning some things up :>
Not sure of the answer here. |
@jreback Green. I'll open an issue for the |
thanks @mattayes |
git diff upstream/master -u -- "*.py" | flake8 --diff
Handles the issue of unstacked object columns filling missing values with
None
instead ofnp.nan
by modifyingpd.core.dtypes.cast.maybe_promote()
to use afill_value
ofnp.nan
(orpd.NaT
) when the originalfill_value
isNone
.Let me know if you'd like me to clarify anything!