Skip to content

Commit 86ed604

Browse files
committed
Pass axis parameter of DataFrame.diff through _get_block_manager_axis
1 parent 03da503 commit 86ed604

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

pandas/core/frame.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3597,10 +3597,8 @@ def diff(self, periods=1, axis=0):
35973597
-------
35983598
diffed : DataFrame
35993599
"""
3600-
# Invert the axis to match the convention of np.diff
3601-
axis = 1 - self._get_axis_number(axis)
3602-
3603-
new_data = self._data.diff(n=periods, axis=axis)
3600+
bm_axis = self._get_block_manager_axis(axis)
3601+
new_data = self._data.diff(n=periods, axis=bm_axis)
36043602
return self._constructor(new_data)
36053603

36063604
#----------------------------------------------------------------------

0 commit comments

Comments
 (0)