pandas: CI: NumPy logical reductions (any, all) fail on DataFrame with NumPy master
https://travis-ci.org/pandas-dev/pandas/jobs/348215410#L2717
[gw1] linux -- Python 3.6.4 /home/travis/miniconda3/envs/pandas/bin/python
self = <pandas.tests.frame.test_analytics.TestDataFrameAnalytics object at 0x7f86fa5d54a8>
axis = 0
@pytest.mark.parametrize("axis", [0, 1, None])
def test_clip_against_frame(self, axis):
df = DataFrame(np.random.randn(1000, 2))
lb = DataFrame(np.random.randn(1000, 2))
ub = lb + 1
> clipped_df = df.clip(lb, ub, axis=axis)
pandas/tests/frame/test_analytics.py:2066:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pandas/core/generic.py:5605: in clip
if np.any(pd.isnull(lower)):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = 0 False
1 False
dtype: bool
def __nonzero__(self):
raise ValueError("The truth value of a {0} is ambiguous. "
"Use a.empty, a.bool(), a.item(), a.any() or a.all()."
> .format(self.__class__.__name__))
E ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 25 (19 by maintainers)
Commits related to this issue
- TST: be robust to clip shapes in dev numpy closes #19976 — committed to jreback/pandas by jreback 6 years ago
- TST: xfail clip tests under numpy-dev xref #19976 — committed to jreback/pandas by jreback 6 years ago
- TST: xfail clip tests under numpy-dev xref #19976 — committed to jreback/pandas by jreback 6 years ago
- TST: xfail clip tests under numpy-dev (#20035) xref #19976 — committed to pandas-dev/pandas by jreback 6 years ago
- Squashed commit of the following: commit df2e361b899d445fe71d4a9188c546f593251cea Author: Jeff Reback <jeff@reback.net> Date: Sun Mar 11 18:33:25 2018 -0400 LINT: fixing commit f1c0b7c3cfc398... — committed to harisbal/pandas by harisbal 6 years ago
- TST: xfail clip tests under numpy-dev (#20035) xref #19976 — committed to pandres/pandas by jreback 6 years ago
Wouldn’t having the same solution as
sum
/prod
be acceptable? I’m not too familiar with Pandas but sounds like it should be handled the same way now, as it is in Numpy?