you must use a new ndarray to store the transferred elements, as described in the documents:
By default, astype always returns a newly allocated array. If thisis set to false, and the dtype, order, and subokrequirements are satisfied, the input array is returned insteadof a copy.