Skip to content

pandas/silent-dtype-coercion

Pack Severity Fix Versions
pandas warning none, edit by hand All versions

Inspect invalid and fractional values before converting a pandas column.

amount = pd.to_numeric(raw_amount, errors='coerce')
amount = pd.to_numeric(raw_amount, errors='raise')
Check invalid or fractional values before casting so they are not silently changed or replaced.

See all rules in the pandas pack.