Skip to content

BUG: clip_lower/-upper don't accept a sequence starting from 0.12.0 #6966

Closed
@immerrr

Description

@immerrr

Here's what I mean:

In [4]: pd.Series(np.arange(7))
Out[4]: 
0    0
1    1
2    2
3    3
4    4
5    5
6    6
dtype: int64

# Let's put some limit on weekends
In [5]: _4.clip_upper([3,3,3,3,3, 4,4])

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-5-3268c7bee292> in <module>()
----> 1 _4.clip_upper([3,3,3,3,3, 4,4])
/home/dshpektorov/sources/pandas/pandas/core/generic.pyc in clip_upper(self, threshold)
   2636         clipped : same type as input
   2637         """
-> 2638         if isnull(threshold):
   2639             raise ValueError("Cannot use an NA value as a clip threshold")
   2640 

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions