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.
Eric _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@python.org https://mail.python.org/mailman/listinfo/numpy-discussion