Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ma.dot no longer always returns a masked array in 1.10 #6611

@ajdawson

Description

@ajdawson

The function numpy.ma.dot in versions <1.10 always returned a masked array, but in 1.10 it does so only if one or both of the inputs are masked array. I couldn't find this documented anywhere in the release notes, so perhaps it is a regression? This broke some code "in the wild" that relied on ma.dot returning a masked array (ajdawson/eofs#34).

A simple code example, which returns a numpy.ma.core.MaskedArray on numpy <1.10 and a numpy.ndarray on numpy 1.10:

a = np.array([[1, 2], [3, 4]])
b = np.array([[5, 6], [7, 8]])
ma.dot(a, b)

It looks like the major change here was probably #5709. Can someone confirm if this is intentional new behaviour or if this is a bug, @charris @abalkin?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions