0

I have the following code,

import pandas as pd
a = ['...', 1]
pd.to_numeric(a, errors = 'coerce', downcast = 'integer')

I expected the output to be,

array([nan,1], dtype = int8)

Instead, I got

array([nan,1.], dtype = float32)

What should I do to get a list of integers? Why does it return float values?

Gagan G
  • 31
  • 1

1 Answers1

0
type(np.nan) #return float

it is considered as float so the problem in nan value

Hamied Amr
  • 11
  • 3