1

I have a program which uses Pandas. I'm getting:

UserWarning: DataFrame columns are not unique, some columns will be omitted.

That seems pretty important. However, it tells me where in PANDAS it finds the problem, but I have no idea where in my code it's finding the problem.

If I run python with -Werror, it errors out too early with some warnings that aren't even being displayed.

Brian Postow
  • 11,709
  • 17
  • 81
  • 125
  • 1
    You can look at [this question](https://stackoverflow.com/questions/5644836/in-python-how-does-one-catch-warnings-as-if-they-were-exceptions) and [this answer](https://stackoverflow.com/questions/15933741/how-do-i-catch-a-numpy-warning-like-its-an-exception-not-just-for-testing/15934081#15934081) which let you use try/except to catch warning. – SSC Feb 17 '17 at 04:32
  • thanks. The answer was what I needed! – Brian Postow Feb 17 '17 at 15:42
  • Possible duplicate of [In Python, how does one catch warnings as if they were exceptions?](https://stackoverflow.com/questions/5644836/in-python-how-does-one-catch-warnings-as-if-they-were-exceptions) – Ivo Merchiers Oct 07 '19 at 12:00

0 Answers0