I have struggle understanding the following anomaly, though I am sure it is ridiculously simple.
I have a list raw_ticker
, with the following values:
raw_ticker = ['t1INCH:USD', 3.5881, 17907.680602819994, 3.5945, 10610.799208380002, -0.0172, -0.0048, 3.5982, 300068.50303883, 3.9639, 2.7685]
I want to convert it to a numpy array ticker
, and specify the data types:
ticker = np.array(raw_ticker,
dtype=[
('symbol', str),
('bid', float),
('bid_size', float),
('ask', float),
('ask_size', float),
('day_chg', float),
('day_chg_p', float),
('last', float),
('vol', float),
('high', float),
('low', float)])
I get the following error :
could not convert string to float: 't1INCH:USD'
which I don't get as I explicitly specified that this field is a string, not a float.