I have a series of very large number having datatype as string. I want to change the datatype to float and then represent the number in scientific notation. The array, which is basically a dataframe column, looks like:
x = [1,784,006,000.00000, 1,821,155,000.000000, 1,825,852,000.000000, 1,826,706,000.000000, 1,911,252,000.000000]
I tried to achieve it using multiple ways but every time I get error like:
could not convert string to float
I understand that the number is huge, so I also tried converting into to numpy array and then use
y = x.astype(np.float)
y = np.asarray(x, dtype=np.float64)
I even tried reading the csv file and enforcing the datatype of respective columns as float
but didn't work either.
Thanks