Saturday 12 December 2020

FutureWarning not displayed with warnings.simplefilter(action = "error", category=FutureWarning)

I am having trouble to find the line of code producing the FutureWarning message: elementwise comparison failed.

There are other questions in SO that describe the python / numpy conflict that cause this warning. I am trying to find which lines are causing this in my code.

When I include these lines in the header section of the code :

import warnings
warnings.simplefilter(action = "default", category=FutureWarning)

Then the warning message displays on console output, but without info to identify where the problem is occurring.

When I include these lines :

import warnings
warnings.simplefilter(action = "error", category=FutureWarning)

then the warning message is not displayed.

I have also used

warnings.filterwarnings()

with the same arguments as simplefilter, and have the same result.

I am trying to run the code and produce a traceback which identifies the offending lines.

What am I not doing correctly ?



from FutureWarning not displayed with warnings.simplefilter(action = "error", category=FutureWarning)

No comments:

Post a Comment