-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
GH #14499 Panel.ffill ignores axis parameter and fill along axis=1 #14528
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
for col, s in self.iteritems()]) | ||
new_obj = self._constructor.\ | ||
from_dict(result).__finalize__(self) | ||
new_data = new_obj._data | ||
|
||
def test_ffill_bfill_axis(self): |
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.
?
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.
fixed
45247b7
to
687869c
Compare
28712bd
to
4fb4dc9
Compare
handle case where |
Current coverage is 84.65% (diff: 100%)@@ master #14528 diff @@
==========================================
Files 144 144
Lines 51030 51039 +9
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 43198 43208 +10
+ Misses 7832 7831 -1
Partials 0 0
|
@jreback you're okay with this pr ? |
is not scalar and ``values`` is not specified (:issue:`14380`) | ||
|
||
- Bug in ``pd.Panel.ffill`` where ``axis`` was not propagated (:issue:`14499`) |
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.
Can you move this to the 0.20.0 file? (0.19.1 is released in the meantime)
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.
done.
@@ -1475,7 +1475,7 @@ def test_fillna(self): | |||
|
|||
panel = self.panel.copy() | |||
panel['str'] = 'foo' | |||
|
|||
print(panel) |
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.
left over
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.
removed
result = dict([(col, s.fillna(method=method, value=value)) | ||
for col, s in self.iteritems()]) | ||
if axis == 0: | ||
frame = self.swapaxes(0, 1) |
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.
Question (not too familiar with Panels): swapping the axes here can potentially cause dtypes to change? (ints upcast to float, or numeric upcast to object when you have mixed dtypes)
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.
Good point. Let me check
4fb4dc9
to
2119035
Compare
@Tux1 can you rebase / update |
2119035
to
5fdf296
Compare
Done
… On 22 Dec 2016, at 07:09, Jeff Reback ***@***.***> wrote:
@Tux1 <https://github.com/Tux1> can you rebase / update
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#14528 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AGWku4E3Ck1ncZf0bkgZaE4sGggfblb0ks5rKbGpgaJpZM4KjmbC>.
|
# can detect if something was set (e.g. in groupby) (GH9221) | ||
if axis is None: | ||
axis = 0 |
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.
axis = self._stat_axis_number
give the correct default
axis2d = 0 | ||
else: | ||
frame = self | ||
axis2d = axis - 1 |
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.
axis == 2
?
downcast=downcast) | ||
if self._is_mixed_type and axis == 1: | ||
if inplace: | ||
raise NotImplementedError() |
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 a message to the NotImplementedError
b0 = a.copy() | ||
b1 = a.copy() | ||
b2 = a.copy() | ||
a['a'].loc[1, 1] = 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.
set using full .loc
, not chained indexing, e.g. f0.loc['a', 1, 1] = np.nan
|
||
# method='ffill' | ||
# axis=0 | ||
assert_panel_equal(a.ffill(axis=0), f0) |
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.
make these expected before each statement, e.g.
result = a.ffill(axis=0)
expected = ......
assert_panel_equal(result, expected)
# method='bfill' | ||
# axis=2 | ||
assert_panel_equal(a.bfill(axis=2), b2) | ||
|
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.
ideally also tests with a panel that has a non-numeric type as well (IOW, add a string to the above example); this should be a separate set of tests.
pls comment if youd like to update / rebase and continue |
git diff upstream/master | flake8 --diff