In [1]:
import warnings
import pandas as pd

In [2]:
df = pd.DataFrame([[0, 1, 2], [3, 4, 5]])

In [3]:
df.ix[0, 0] = 0


/usr/local/lib/python3.7/site-packages/ipykernel_launcher.py:1: FutureWarning: 
.ix is deprecated. Please use
.loc for label based indexing or
.iloc for positional indexing

See the documentation here:
http://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#ix-indexer-is-deprecated
  """Entry point for launching an IPython kernel.

In [4]:
df.iloc[:1][0] = 0


/usr/local/lib/python3.7/site-packages/ipykernel_launcher.py:1: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
  """Entry point for launching an IPython kernel.

In [5]:
warnings.simplefilter('ignore')

In [6]:
df.ix[0, 0] = 0

In [7]:
df.iloc[:1][0] = 0

In [8]:
warnings.resetwarnings()

In [9]:
warnings.simplefilter('ignore', FutureWarning)

In [10]:
df.ix[0, 0] = 0

In [11]:
df.iloc[:1][0] = 0


/usr/local/lib/python3.7/site-packages/ipykernel_launcher.py:1: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
  """Entry point for launching an IPython kernel.

In [12]:
warnings.resetwarnings()

In [13]:
# warnings.simplefilter('ignore', SettingWithCopyWarning)
# NameError: name 'SettingWithCopyWarning' is not defined

In [14]:
warnings.simplefilter('ignore', pd.core.common.SettingWithCopyWarning)

In [15]:
df.ix[0, 0] = 0


/usr/local/lib/python3.7/site-packages/ipykernel_launcher.py:1: FutureWarning: 
.ix is deprecated. Please use
.loc for label based indexing or
.iloc for positional indexing

See the documentation here:
http://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#ix-indexer-is-deprecated
  """Entry point for launching an IPython kernel.

In [16]:
df.iloc[:1][0] = 0

In [17]:
warnings.resetwarnings()

In [18]:
warnings.simplefilter('error')

In [19]:
# df.ix[0, 0] = 0
# FutureWarning: ...

In [20]:
warnings.resetwarnings()

In [21]:
warnings.simplefilter('ignore', FutureWarning)
warnings.simplefilter('error', pd.core.common.SettingWithCopyWarning)

In [22]:
df.ix[0, 0] = 0

In [23]:
# df.iloc[:1][0] = 0
# SettingWithCopyWarning: ...

In [24]:
warnings.resetwarnings()

In [25]:
with warnings.catch_warnings():
    warnings.simplefilter('ignore')
    df.ix[0, 0] = 0

In [26]:
df.ix[0, 0] = 0


/usr/local/lib/python3.7/site-packages/ipykernel_launcher.py:1: FutureWarning: 
.ix is deprecated. Please use
.loc for label based indexing or
.iloc for positional indexing

See the documentation here:
http://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#ix-indexer-is-deprecated
  """Entry point for launching an IPython kernel.