[Numpy-discussion] Looking for a difference between Numpy 0.19.5 and 0.20 explaining a perf regression with Pythran

Eric Firing efiring at hawaii.edu
Fri Mar 12 18:53:23 EST 2021

On 2021/03/12 1:33 PM, PIERRE AUGIER wrote:
> arr.copy() or np.copy(arr) do not give the same result, with arr obtained from a Pandas dataframe with arr = df.values. It's strange because type(df.values) gives <class 'numpy.ndarray'> so I would expect arr.copy() and np.copy(arr) to give exactly the same result.

According to the docstrings for numpy.copy and arr.copy, the function 
and the method have different defaults for the memory layout.  np.copy() 
tries to maintain the order of the original while arr.copy() defaults to 
C order.


More information about the NumPy-Discussion mailing list