Skip to content

Commit 36851c7

Browse files
committed
BUG: catch Exception instead of TypeError in multi-groupby code, surfaced due to # of args in DataFrame.mean changing in PR #313
1 parent e775d09 commit 36851c7

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

RELEASE.rst

+6
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ pandas 0.5.1
3030
**New features / modules**
3131

3232
- Add `melt` function to `pandas.core.reshape`
33+
- Add `level` parameter to group by level in Series and DataFrame
34+
descriptive statistics (PR #313)
35+
- Add `head` and `tail` methods to Series, analogous to to DataFrame (PR
36+
#296)
3337

3438
**Improvements to existing features**
3539

@@ -46,6 +50,8 @@ Thanks
4650
------
4751

4852
- Kieran O'Mahony
53+
- Jeff Hammerbacher
54+
- Adam Klein
4955

5056
pandas 0.5.0
5157
============

pandas/core/groupby.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,9 @@ def _doit(reschunk, ctchunk, gen, shape_axis=0):
388388
mask = counts.ravel() > 0
389389
output = output.reshape((np.prod(group_shape),) + stride_shape)
390390
output = output[mask]
391-
except TypeError:
391+
except Exception:
392+
# we failed, try to go slice-by-slice / column-by-column
393+
392394
result = np.empty(group_shape, dtype=float)
393395
result.fill(np.nan)
394396
# iterate through "columns" ex exclusions to populate output dict

0 commit comments

Comments
 (0)