-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Reindex with columns and method #14993
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
tests please |
dtype=float) | ||
expected_def = DataFrame(data=[[np.nan, 11, 12, np.nan, 13, np.nan], | ||
[np.nan, 21, 22, np.nan, 23, np.nan], | ||
[np.nan, 31, 32, np.nan, 33, np.nan]], |
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.
you can just do these as:
result = ....
expected = ...
assert_frame_equal(result, expected)
easier to read this way
@@ -297,6 +297,35 @@ def test_reindex_columns(self): | |||
newFrame = self.frame.reindex(columns=[]) | |||
self.assertTrue(newFrame.empty) | |||
|
|||
# GH 14992, reindexing over columns ignored method |
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.
you can make it a new test
[21, 21, 22, 23, 23, np.nan], | ||
[31, 31, 32, 33, 33, np.nan]], | ||
index=[1, 2, 4], | ||
columns=range(6), |
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 similar tests for sparse as well.
@@ -285,6 +285,7 @@ Bug Fixes | |||
- Bug in ``DataFrame(..).apply(to_numeric)`` when values are of type decimal.Decimal. (:issue:`14827`) | |||
- Bug in ``describe()`` when passing a numpy array which does not contain the median to the ``percentiles`` keyword argument (:issue:`14908`) | |||
- Bug in ``DataFrame.sort_values()`` when sorting by multiple columns where one column is of type ``int64`` and contains ``NaT`` (:issue:`14922`) | |||
- Bug in ``DataFrame.reindex()`` when using ``columns`` and ``method`` (:issue:`14992`) |
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.
say that when passingcolumns
, method
was ignored.
Current coverage is 84.78% (diff: 100%)@@ master #14993 diff @@
==========================================
Files 144 145 +1
Lines 51056 51091 +35
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 43225 43316 +91
+ Misses 7831 7775 -56
Partials 0 0
|
thanks! |
git diff upstream/master | flake8 --diff