8000 ma.asarray does not default to C order as stated. · Issue #6646 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content
8000

ma.asarray does not default to C order as stated. #6646

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
charris opened this issue Nov 6, 2015 · 1 comment
Closed

ma.asarray does not default to C order as stated. #6646

charris opened this issue Nov 6, 2015 · 1 comment

Comments

@charris
Copy link
Member
charris commented Nov 6, 2015

In fact, the order keyword is ignored.

In [7]: a = eye(3).T

In [8]: a.flags
Out[8]: 
  C_CONTIGUOUS : False
  F_CONTIGUOUS : True
  OWNDATA : False
  WRITEABLE : True
  ALIGNED : True
  UPDATEIFCOPY : False

In [9]: ma.asarray(a).flags
Out[9]: 
  C_CONTIGUOUS : False
  F_CONTIGUOUS : True
  OWNDATA : False
  WRITEABLE : True
  ALIGNED : True
  UPDATEIFCOPY : False

In [10]: ma.asarray(a, order='C').flags
Out[10]: 
  C_CONTIGUOUS : False
  F_CONTIGUOUS : True
  OWNDATA : False
  WRITEABLE : True
  ALIGNED : True
  UPDATEIFCOPY : False
@gfyoung
Copy link
Contributor
gfyoung commented Dec 31, 2015

Because copy is False in the __new__ method for the MaskedArray class when it is called from asarray, the order for the _data object is variable (either C or Fortran). Thus, to ensure ordering, I think you can just add an order parameter to that method. I can put up a PR for that quickly.

661E
jaimefrio pushed a commit to jaimefrio/numpy that referenced this issue Mar 22, 2016
Adds the 'order' parameter to the __new__ override
in MaskedArray construction, enabling it to be enforced
in methods like np.ma.core.array and np.ma.core.asarray.

Closes numpygh-6646.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants
0