Skip to content

numpy.ma.zeros/ones/empty don't work correctly with keyword arguments #4582

Closed
@gerritholl

Description

@gerritholl

The zeros/ones/empty constructors for 'numpy.ma' don't like to be called with keyword arguments shape, dtype:

In [1]: numpy.ma.zeros(2, "f8")
Out[1]: 
masked_array(data = [ 0.  0.],
             mask = False,
       fill_value = 1e+20)

In [2]: numpy.ma.zeros(shape=2, dtype="f8")
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-2-1a1b42c40a81> in <module>()
----> 1 numpy.ma.zeros(shape=2, dtype="f8")

TypeError: __call__() missing 1 required positional argument: 'a'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions