I am using pandas to read a file using read_csv()
. In it I have set warn_bad_lines as True
and error_bad_lines as False
to identify rows with extra delimiters. And I am getting proper warnings. Can I store these warnings into a variable so that i can use it later?
This is the script:
import pandas as pd
df = pd.read_csv('file.txt', delimiter = '|', error_bad_lines = False , warn_bad_lines = True)