'numpy array custom dtype for the list of list
I am confusing in using custom dtype of numpy array which is converting the element of the list to be tuple.
np.empty (1000, dtype = [('a',int), ('b','S4')])
this would result an array with a tuple type, is this part of the code got err? or if it is acutally not possibile to have the custom type to be in list format?
Solution 1:[1]
Answer:
dtype = np.dtype((int,int))
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Daniel Farrell |