From ac346715c4d0cc14ba44e2afcfdab8fdb1617357 Mon Sep 17 00:00:00 2001 From: y-p Date: Fri, 14 Dec 2012 05:20:25 +0200 Subject: [PATCH] ENH: df.select uses bool(crit(x)) rather then crit(x) GH2487 --- RELEASE.rst | 2 ++ pandas/core/generic.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/RELEASE.rst b/RELEASE.rst index 93941ebf11450..0d4d6670c6591 100644 --- a/RELEASE.rst +++ b/RELEASE.rst @@ -170,6 +170,7 @@ pandas 0.10.0 - Optimize ``unstack`` memory usage by compressing indices (GH2278_) - Fix HTML repr in IPython qtconsole if opening window is small (GH2275_) - Escape more special characters in console output (GH2492_) + - df.select now invokes bool on the result of crit(x) (GH2487_) **Bug fixes** @@ -297,6 +298,7 @@ pandas 0.10.0 .. _GH2447: https://github.com/pydata/pandas/issues/2447 .. _GH2275: https://github.com/pydata/pandas/issues/2275 .. _GH2492: https://github.com/pydata/pandas/issues/2492 +.. _GH2487: https://github.com/pydata/pandas/issues/2487 .. _GH2273: https://github.com/pydata/pandas/issues/2273 .. _GH2266: https://github.com/pydata/pandas/issues/2266 .. _GH2038: https://github.com/pydata/pandas/issues/2038 diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 5355db8eaabcc..9c3c85d2a0d5f 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -315,7 +315,7 @@ def select(self, crit, axis=0): axis = self._get_axis(axis) if len(axis) > 0: - new_axis = axis[np.asarray([crit(label) for label in axis])] + new_axis = axis[np.asarray([bool(crit(label)) for label in axis])] else: new_axis = axis