0

Currently after importing the data the datatype is float64, but I want to change this to float128, since the data I am using is very large.

Below you can find the code I have tried:

df1m = pd.read_csv('btcusd.csv')     # import dataset
df1m = df1m.astype('float128')       # change to float128

But this gives the following error: TypeError: data type "float128" not understood

I have looked around on stackoverflow but I couldn't find an answer... Hopefully you can help me!

Luc
  • 7
  • 1
  • 5
  • 1
    from reading [this](https://stackoverflow.com/questions/63289402/how-to-define-np-float128-variable-in-python) question, it would seem that `float128` doesnt work on windows. are you on windows? – Nullman Feb 03 '21 at 09:59
  • which pandas version u r using? In my linux system it works. `pandas==1.1.0` – Pygirl Feb 03 '21 at 09:59
  • @Nullman -> I am indeed on Windows – Luc Feb 03 '21 at 10:00
  • @Pygirl -> I just checked and I am using version 1.0.1 -> I would probably need to update pandas? – Luc Feb 03 '21 at 10:01
  • [this](https://stackoverflow.com/questions/29820829/cannot-use-128bit-float-in-python-on-64bit-architecture) answer your problem. – Pygirl Feb 03 '21 at 10:03
  • @Pygirl I will try that out, thanks a lot for the help! – Luc Feb 03 '21 at 10:06
  • can confirm that float128 doesn't exist in Windows [source](https://stackoverflow.com/questions/9062562/what-is-the-internal-precision-of-numpy-float128), and for what I have read, you have to stick to np.longdouble :/ – Orozco Feb 03 '21 at 10:14

0 Answers0