I am doing something fairly simple, I'm trying to convert a list of lists to an np.array:
rows = [[1, 'None', 'None', 0, 0, 'None', 0, 0],
[2, 'None', 'None', 0, 0, 'None', 0, 0],
[3, 'None', 'None', 0, 0, 'None', 0, 0],
[4, 'None', 'None', 0, 0, 'None', 0, 0],
[5, 'None', 'None', 0, 0, 'None', 0, 0]]
dtypes = np.dtype(
[
('_ID', np.int),
('SOURCE_LILST', '|S1024'),
('PRI_SOURCE', '|S256'),
('PRI_SOURCE_CNT', np.int32),
('PRI_SOURCE_PER', np.float64),
('SEC_SOURCE', '|S256'),
('SEC_SOURCE_CNT', np.int32),
('SEC_SOURCE_PER', np.float64)
]
)
array = np.array(rows, dtypes) # error raised
Can anyone see what the issue it?
Thank you