A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/54296 below:

read_csv(on_bad_lines="warn") should raise a `UserWarning` instead of writing to stderr · Issue #54296 · pandas-dev/pandas · GitHub

As the docs state

‘warn’, raise a warning when a bad line is encountered and skip that line.

In [4]: pd.read_csv(StringIO(data), on_bad_lines="warn")
Skipping line 3: expected 1 fields, saw 3
Skipping line 5: expected 1 fields, saw 3

Out[4]: 
   a
0  1
1  4

Since it's not a Python warning it cannot be handled with the warnings module per se.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4