I am trying to read some data which may sometimes have erroneous and bad rows, so as always I passed error_bad_lines=False
but the console keeps throwing the deprecation warning on every run. Why is this feature deprecated and is there any other alternative for skipping bad lines?
Read the documentation:
Deprecated since version 1.3.0: The on_bad_lines parameter should be used instead to specify behavior upon encountering a bad line instead.
So, replace:
df = pd.read_csv(..., error_bad_lines=False)
with:
df = pd.read_csv(..., on_bad_lines='skip')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With