Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas convert float to int with nan null value

#First replace all NaN values with 0 and convert
df['col'] = df['col'].fillna(0).astype(int)
 
PREVIOUS NEXT
Tagged: #pandas #convert #float #int #nan #null
ADD COMMENT
Topic
Name
6+2 =