Skip to content

Commit 0a9d496

Browse files
committed
ENH: groupby refactoring to enable reasonably fast resampling of panel data, unit test for user-specified function fails #1149
1 parent ce38e6f commit 0a9d496

File tree

5 files changed

+263
-159
lines changed

5 files changed

+263
-159
lines changed

pandas/core/frame.py

+17
Original file line numberDiff line numberDiff line change
@@ -1259,6 +1259,23 @@ def transpose(self):
12591259

12601260
T = property(transpose)
12611261

1262+
def swapaxes(self, i, j):
1263+
"""
1264+
Like ndarray.swapaxes, equivalent to transpose
1265+
1266+
Returns
1267+
-------
1268+
swapped : DataFrame
1269+
View on original data (no copy)
1270+
"""
1271+
if i in (0, 1) and j in (0, 1):
1272+
if i == j:
1273+
return self
1274+
return self._constructor(data=self.values.T, index=self.columns,
1275+
columns=self.index, copy=False)
1276+
else: # pragma: no cover
1277+
raise ValueError('Axis numbers must be in (0, 1)')
1278+
12621279
#----------------------------------------------------------------------
12631280
# Picklability
12641281

0 commit comments

Comments
 (0)