I have data like:
I want to make all numerical values to int, no decimal will be here. like this:
I was using code like list:
df=pd.read_csv("file.csv")
df = df.astype('int64')
But it was not working. Because it was saying:
ValueError: Cannot convert NA to integer
Because, I have some nan value inside. There are string also in the column one row 2&3. I think the solution could be, selecting all numerical values from the data frame and converting to int. Can you suggest anything?