Questions tagged [python-warnings]

2 questions
1
vote
1 answer

How to correct this code to not raise a SettingWithCopyWarning?

I'm following along with this - https://www.kdnuggets.com/2021/01/cleaner-data-analysis-pandas-pipes.html About halfway down the author creates a function to remove outliers def to_category(df): cols = df.select_dtypes(include='object').columns …
1
vote
1 answer

Avoid formatting issues when warnings.captureWarnings(True) is set

I have created a log handler which logs to a database table, and I wanted to also capture warnings issued by the program into a different table, so used warnings.captureWarnings(True) I had some issues with the message formatting in the py.warnings…
Stev_k
  • 2,118
  • 3
  • 22
  • 36