So I have following code snippet:
with open('dataset/train/problem.csv', 'r') as p:
raw_x = csv.reader(p)
data_x = []
for ix in raw_x:
data_x.append([float(i) for i in ix])
print(data_x)
This prints the following output:
[[217.0, 118.0, 0.63, 755.0, 1071.0], [217.0, 118.0, 0.63, 755.0, 1071.0],...]
Now I am trying to convert this structure into a numpy array of floats so that I can use it with scikit-learn as an observation input. But when I try doing following
X = np.array(data_x)
print(X)
It gives the following result:
[ 2.17000000e+02 1.18000000e+02 6.30000000e-01 7.55000000e+02
1.07100000e+03]
...
[ 2.17000000e+02 1.18000000e+02 6.30000000e-01 7.55000000e+02
1.07100000e+03]
It's still float but the decimal values are not correct.
Been trying to figure out why this is happening as the source array is also in floats. I have tried providing type=float and astype as well but nothing seems to work.
Thanks!