1

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)
meW
  • 3,832
  • 7
  • 27
  • Possible duplicate, check this question, i guess it's the same: https://stackoverflow.com/questions/32334966/pandas-bad-lines-warning-capture – Manrique Dec 18 '18 at 11:59
  • Possible duplicate of [Pandas Bad Lines Warning Capture](https://stackoverflow.com/questions/32334966/pandas-bad-lines-warning-capture) – tel Dec 18 '18 at 12:30
  • The duplicate addresses the identical question. It even focuses on `read_csv()` – tel Dec 18 '18 at 12:31

0 Answers0