1

How do you go about hiding the following warnings?

I did write the following but it doesn't work:

warnings.filterwarnings("ignore", category=DeprecationWarning) 

I also run the code using

%run -i "Admin_Vision_POC_Version_0_E.py" -W ignore

Here is the list of warnings that I'm getting:

Admin_Vision_POC_Version_0_E.py:218: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
  output = interactive_w2v_mode('w2v_model_bigdata',arg)
Admin_Vision_POC_Version_0_E.py:219: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame

    See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
      maximumKey = max(output.items(), key=operator.itemgetter(1))[0]
    c:\Anaconda3\lib\site-packages\pandas\core\frame.py:4133: SettingWithCopyWarning: 
    A value is trying to be set on a copy of a slice from a DataFrame

    See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
      errors=errors,

1 Answer 1

2

I ended up using the following code to suppress warnings:

pd.options.mode.chained_assignment = None
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.