8000 Piecewise bug with scalar domains and more than 2 conditions · Issue #5729 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content
Piecewise bug with scalar domains and more than 2 conditions #5729
Closed
@jakobgager

Description

@jakobgager

(Commented in #4792)
There, seems to be an issue with scalar domains and three or more conditions:

>>> np.piecewise(3, [True, False, False],[4,2,0])
ValueError: function list and condition list must be the same    

Funny enough it works fine with two conditions (this is what has been tested):

>>> np.piecewise(3, [True, False],[4,2])
array(4)

The three conditions version works fine with select:

>>> np.select([True, False, False],[4,2,0])
array(4)

Tested on python 3.4 with numpy 1.9.0 and python 2.7.6 with numpy 1.8.2

Metadata

Metadata

Assignees

No one assigned

    Type

    39FB
    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0