I have a table that looks as follows:
City | Value |
---|---|
<String> | <String> |
Chicago | 12 |
Detriot | 15 |
Jersery City | 20 |
This table is locked in this format:
import numpy as np
x = np.array([('Chicago', '12'),('Detriot', '15'),('Jersery City', '20')])
I did some research on Stack Overflow and came to this post here. However I don't know why it is not working. I tried the following code:
x[:,1] = x[:,1].astype(int)
I even tried the following as well and it did not work:
x[:,[1]] = x[:,[1]].astype(int)
However this line when run returns the following:
type(x[0,1])
numpy.str_