Aug-18-2020, 06:46 PM
Hi,
I have created a numpy array and would like to change the order. While using I am getting below error.
I have created a numpy array and would like to change the order. While using I am getting below error.
import numpy as np a = np.array([1,2,3]) b = np.array([(1.5,2,3), (4,5,6)], dtype = [('col1','<f8'),('col2','<i4'),('col3','<i4')]) names_list=['col2','col1','col3'] c=b[names_list] print(c.dtype.descr)
Error:lib\site-packages\numpy\core\_internal.py", line 114, in _array_descr
raise ValueError(
ValueError: dtype.descr is not defined for types with overlapping or out-of-order fields