Python Forum
How to resolve numpy ValueError: dtype.descr
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to resolve numpy ValueError: dtype.descr
#1
Hi,

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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [split] How to resolve version conflicts in Python? atonalwilson 1 950 May-04-2023, 09:02 AM
Last Post: buran
  How to resolve version conflicts in Python? taeefnajib 0 873 Apr-27-2023, 08:37 PM
Last Post: taeefnajib
  How to resolve my problem in Pycharm? bshoushtarian 0 821 Sep-26-2022, 11:45 AM
Last Post: bshoushtarian
  Solving equation equal to zero: How to resolve the syntax error? alexfrol86 3 1,894 Feb-21-2022, 08:58 AM
Last Post: deanhystad
  win32com — How to resolve “AttributeError: xlUp” for Excel files? JaneTan 2 4,129 Aug-18-2021, 05:27 AM
Last Post: snippsat
  How to resolve Index Error in my code? codify110 6 2,956 May-22-2021, 11:04 AM
Last Post: supuflounder
  Extracting data without showing dtype, name etc. tgottsc1 3 4,204 Jan-10-2021, 02:15 PM
Last Post: buran
  Dtype STR but output in Shell still int? johnjfk 6 2,211 Oct-04-2020, 01:34 PM
Last Post: johnjfk
  Need help to resolve this MK2020 1 3,339 Mar-28-2020, 05:04 AM
Last Post: SheeppOSU
  wrap_text with openpyxl. How to use documentation to resolve deprecation warning? curranjohn46 4 14,221 Oct-09-2019, 01:04 PM
Last Post: curranjohn46

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020