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

Skip to content

Conversation

@charris
Copy link
Member

@charris charris commented Oct 7, 2016

Rebase of #6456.

Fixes a bug with deepcopy of object arrays in F-order:

In [1]: import numpy as np

In [2]: np.__version__       
Out[2]: '1.11.0.dev0+9cc55dc'

In [3]: a = {'a': 1}

In [4]: b = {'b': 2}

In [5]: np.array([[a, b], [a, b]], order='F')
Out[5]: 
array([[{'a': 1}, {'b': 2}],
       [{'a': 1}, {'b': 2}]], dtype=object)

In [6]: import copy

In [7]: copy.deepcopy(np.array([[a, b], [a, b]], order='F'))
Out[7]: 
array([[{'a': 1}, {'a': 1}],
       [{'b': 2}, {'b': 2}]], dtype=object)

This was discovered as part of a bug found with biggus in SciTools/biggus#157.

@charris charris merged commit b0159a9 into numpy:master Oct 7, 2016
@charris charris deleted the deepcopy_object branch October 7, 2016 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants