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
  What's the meaning of dtype=mesh.Mesh.dtype? FerdiFuchs 2 199 May-10-2024, 11:39 AM
Last Post: FerdiFuchs
  [split] How to resolve version conflicts in Python? atonalwilson 1 1,032 May-04-2023, 09:02 AM
Last Post: buran
  How to resolve version conflicts in Python? taeefnajib 0 961 Apr-27-2023, 08:37 PM
Last Post: taeefnajib
  How to resolve my problem in Pycharm? bshoushtarian 0 889 Sep-26-2022, 11:45 AM
Last Post: bshoushtarian
  Solving equation equal to zero: How to resolve the syntax error? alexfrol86 3 2,034 Feb-21-2022, 08:58 AM
Last Post: deanhystad
  win32com — How to resolve “AttributeError: xlUp” for Excel files? JaneTan 2 4,324 Aug-18-2021, 05:27 AM
Last Post: snippsat
  How to resolve Index Error in my code? codify110 6 3,119 May-22-2021, 11:04 AM
Last Post: supuflounder
  Extracting data without showing dtype, name etc. tgottsc1 3 4,568 Jan-10-2021, 02:15 PM
Last Post: buran
  Dtype STR but output in Shell still int? johnjfk 6 2,315 Oct-04-2020, 01:34 PM
Last Post: johnjfk
  Need help to resolve this MK2020 1 3,418 Mar-28-2020, 05:04 AM
Last Post: SheeppOSU

Forum Jump:

User Panel Messages

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