pandas replace non numeric values code example
Example 1: pandas replace non numeric values with 0?
training_data['usagequantity'] = (
pd.to_numeric(training_data['usagequantity'],
errors='coerce')
.fillna(0)
)
Example 2: pandas replace non numeric values with 0?
df.col =pd.to_numeric(df.col, errors ='coerce').fillna(0).astype('int')