diff --git a/doc/source/whatsnew/v0.20.0.txt b/doc/source/whatsnew/v0.20.0.txt
index 6e9dfb92dfd903..dc8420080b50d1 100644
--- a/doc/source/whatsnew/v0.20.0.txt
+++ b/doc/source/whatsnew/v0.20.0.txt
@@ -548,6 +548,8 @@ Removal of prior version deprecations/changes
- ``pd.to_datetime`` and ``pd.to_timedelta`` have dropped the ``coerce`` parameter in favor of ``errors`` (:issue:`13602`)
- ``pandas.stats.fama_macbeth``, ``pandas.stats.ols``, ``pandas.stats.plm`` and ``pandas.stats.var``, as well as the top-level ``pandas.fama_macbeth`` and ``pandas.ols`` routines are removed. Similar functionaility can be found in the `statsmodels `__ package. (:issue:`11898`)
- ``Series.is_time_series`` is dropped in favor of ``Series.index.is_all_dates`` (:issue:``)
+- The deprecated ``irow``, ``icol``, ``iget`` and ``iget_value`` methods are removed
+ in favor of ``iloc`` and ``iat`` as explained :ref:`here ` (:issue:`10711`).
.. _whatsnew_0200.performance:
diff --git a/pandas/core/frame.py b/pandas/core/frame.py
index 021ce59e3402b7..0d14f00bee5089 100644
--- a/pandas/core/frame.py
+++ b/pandas/core/frame.py
@@ -1916,23 +1916,6 @@ def set_value(self, index, col, value, takeable=False):
return self
- def irow(self, i, copy=False):
- """
- DEPRECATED. Use ``.iloc[i]`` instead
- """
-
- warnings.warn("irow(i) is deprecated. Please use .iloc[i]",
- FutureWarning, stacklevel=2)
- return self._ixs(i, axis=0)
-
- def icol(self, i):
- """
- DEPRECATED. Use ``.iloc[:, i]`` instead
- """
- warnings.warn("icol(i) is deprecated. Please use .iloc[:,i]",
- FutureWarning, stacklevel=2)
- return self._ixs(i, axis=1)
-
def _ixs(self, i, axis=0):
"""
i : int, slice, or sequence of integers
@@ -2007,14 +1990,6 @@ def _ixs(self, i, axis=0):
return result
- def iget_value(self, i, j):
- """
- DEPRECATED. Use ``.iat[i, j]`` instead
- """
- warnings.warn("iget_value(i, j) is deprecated. Please use .iat[i, j]",
- FutureWarning, stacklevel=2)
- return self.iat[i, j]
-
def __getitem__(self, key):
key = com._apply_if_callable(key, self)
diff --git a/pandas/core/groupby.py b/pandas/core/groupby.py
index 381a8edcb51923..578c334781d15f 100644
--- a/pandas/core/groupby.py
+++ b/pandas/core/groupby.py
@@ -1004,16 +1004,6 @@ class GroupBy(_GroupBy):
"""
_apply_whitelist = _common_apply_whitelist
- def irow(self, i):
- """
- DEPRECATED. Use ``.nth(i)`` instead
- """
-
- # 10177
- warnings.warn("irow(i) is deprecated. Please use .nth(i)",
- FutureWarning, stacklevel=2)
- return self.nth(i)
-
@Substitution(name='groupby')
@Appender(_doc_template)
def count(self):
diff --git a/pandas/core/series.py b/pandas/core/series.py
index ffe1be26fda549..1114590421fd84 100644
--- a/pandas/core/series.py
+++ b/pandas/core/series.py
@@ -875,31 +875,6 @@ def reshape(self, *args, **kwargs):
return self._values.reshape(shape, **kwargs)
- def iget_value(self, i, axis=0):
- """
- DEPRECATED. Use ``.iloc[i]`` or ``.iat[i]`` instead
- """
- warnings.warn("iget_value(i) is deprecated. Please use .iloc[i] or "
- ".iat[i]", FutureWarning, stacklevel=2)
- return self._ixs(i)
-
- def iget(self, i, axis=0):
- """
- DEPRECATED. Use ``.iloc[i]`` or ``.iat[i]`` instead
- """
-
- warnings.warn("iget(i) is deprecated. Please use .iloc[i] or .iat[i]",
- FutureWarning, stacklevel=2)
- return self._ixs(i)
-
- def irow(self, i, axis=0):
- """
- DEPRECATED. Use ``.iloc[i]`` or ``.iat[i]`` instead
- """
- warnings.warn("irow(i) is deprecated. Please use .iloc[i] or .iat[i]",
- FutureWarning, stacklevel=2)
- return self._ixs(i)
-
def get_value(self, label, takeable=False):
"""
Quickly retrieve single value at passed index label
diff --git a/pandas/tests/frame/test_indexing.py b/pandas/tests/frame/test_indexing.py
index 18fb17b98570ac..36c39ffba70b3e 100644
--- a/pandas/tests/frame/test_indexing.py
+++ b/pandas/tests/frame/test_indexing.py
@@ -1761,13 +1761,9 @@ def test_single_element_ix_dont_upcast(self):
result = df.loc[[0], "b"]
assert_series_equal(result, expected)
- def test_irow(self):
+ def test_iloc_row(self):
df = DataFrame(np.random.randn(10, 4), index=lrange(0, 20, 2))
- # 10711, deprecated
- with tm.assert_produces_warning(FutureWarning):
- df.irow(1)
-
result = df.iloc[1]
exp = df.loc[2]
assert_series_equal(result, exp)
@@ -1795,14 +1791,10 @@ def f():
expected = df.reindex(df.index[[1, 2, 4, 6]])
assert_frame_equal(result, expected)
- def test_icol(self):
+ def test_iloc_col(self):
df = DataFrame(np.random.randn(4, 10), columns=lrange(0, 20, 2))
- # 10711, deprecated
- with tm.assert_produces_warning(FutureWarning):
- df.icol(1)
-
result = df.iloc[:, 1]
exp = df.loc[:, 2]
assert_series_equal(result, exp)
@@ -1828,8 +1820,7 @@ def f():
expected = df.reindex(columns=df.columns[[1, 2, 4, 6]])
assert_frame_equal(result, expected)
- def test_irow_icol_duplicates(self):
- # 10711, deprecated
+ def test_iloc_duplicates(self):
df = DataFrame(np.random.rand(3, 3), columns=list('ABC'),
index=list('aab'))
@@ -1874,16 +1865,12 @@ def test_irow_icol_duplicates(self):
expected = df.take([0], axis=1)
assert_frame_equal(result, expected)
- def test_icol_sparse_propegate_fill_value(self):
+ def test_iloc_sparse_propegate_fill_value(self):
from pandas.sparse.api import SparseDataFrame
df = SparseDataFrame({'A': [999, 1]}, default_fill_value=999)
self.assertTrue(len(df['A'].sp_values) == len(df.iloc[:, 0].sp_values))
- def test_iget_value(self):
- # 10711 deprecated
-
- with tm.assert_produces_warning(FutureWarning):
- self.frame.iget_value(0, 0)
+ def test_iat(self):
for i, row in enumerate(self.frame.index):
for j, col in enumerate(self.frame.columns):
diff --git a/pandas/tests/frame/test_nonunique_indexes.py b/pandas/tests/frame/test_nonunique_indexes.py
index d6bcb85e019107..bb7c7c2bd012d9 100644
--- a/pandas/tests/frame/test_nonunique_indexes.py
+++ b/pandas/tests/frame/test_nonunique_indexes.py
@@ -429,7 +429,7 @@ def test_columns_with_dups(self):
self.assertEqual(len(df._data._blknos), len(df.columns))
self.assertEqual(len(df._data._blklocs), len(df.columns))
- # testing iget
+ # testing iloc
for i in range(len(df.columns)):
df.iloc[:, i]
diff --git a/pandas/tests/groupby/test_groupby.py b/pandas/tests/groupby/test_groupby.py
index 59cbcab23b9e78..74e8c6c45946f8 100644
--- a/pandas/tests/groupby/test_groupby.py
+++ b/pandas/tests/groupby/test_groupby.py
@@ -3828,20 +3828,6 @@ def test_groupby_whitelist(self):
'mad', 'std', 'var', 'sem']
AGG_FUNCTIONS_WITH_SKIPNA = ['skew', 'mad']
- def test_groupby_whitelist_deprecations(self):
- from string import ascii_lowercase
- letters = np.array(list(ascii_lowercase))
- N = 10
- random_letters = letters.take(np.random.randint(0, 26, N))
- df = DataFrame({'floats': N / 10 * Series(np.random.random(N)),
- 'letters': Series(random_letters)})
-
- # 10711 deprecated
- with tm.assert_produces_warning(FutureWarning):
- df.groupby('letters').irow(0)
- with tm.assert_produces_warning(FutureWarning):
- df.groupby('letters').floats.irow(0)
-
def test_regression_whitelist_methods(self):
# GH6944
@@ -3917,7 +3903,7 @@ def test_tab_completion(self):
'first', 'get_group', 'groups', 'hist', 'indices', 'last', 'max',
'mean', 'median', 'min', 'name', 'ngroups', 'nth', 'ohlc', 'plot',
'prod', 'size', 'std', 'sum', 'transform', 'var', 'sem', 'count',
- 'nunique', 'head', 'irow', 'describe', 'cummax', 'quantile',
+ 'nunique', 'head', 'describe', 'cummax', 'quantile',
'rank', 'cumprod', 'tail', 'resample', 'cummin', 'fillna',
'cumsum', 'cumcount', 'all', 'shift', 'skew', 'bfill', 'ffill',
'take', 'tshift', 'pct_change', 'any', 'mad', 'corr', 'corrwith',
diff --git a/pandas/tests/series/test_indexing.py b/pandas/tests/series/test_indexing.py
index 8a2cc53b42938e..bb77550e01f114 100644
--- a/pandas/tests/series/test_indexing.py
+++ b/pandas/tests/series/test_indexing.py
@@ -164,22 +164,10 @@ def test_getitem_get(self):
result = s.get(None)
self.assertIsNone(result)
- def test_iget(self):
+ def test_iloc(self):
s = Series(np.random.randn(10), index=lrange(0, 20, 2))
- # 10711, deprecated
- with tm.assert_produces_warning(FutureWarning):
- s.iget(1)
-
- # 10711, deprecated
- with tm.assert_produces_warning(FutureWarning):
- s.irow(1)
-
- # 10711, deprecated
- with tm.assert_produces_warning(FutureWarning):
- s.iget_value(1)
-
for i in range(len(s)):
result = s.iloc[i]
exp = s[s.index[i]]
@@ -199,7 +187,7 @@ def test_iget(self):
expected = s.reindex(s.index[[0, 2, 3, 4, 5]])
assert_series_equal(result, expected)
- def test_iget_nonunique(self):
+ def test_iloc_nonunique(self):
s = Series([0, 1, 2], index=[0, 1, 0])
self.assertEqual(s.iloc[2], 2)
diff --git a/pandas/tests/sparse/test_frame.py b/pandas/tests/sparse/test_frame.py
index e3b865492c0432..b2283364a16317 100644
--- a/pandas/tests/sparse/test_frame.py
+++ b/pandas/tests/sparse/test_frame.py
@@ -389,8 +389,7 @@ def test_getitem(self):
self.assertRaises(Exception, sdf.__getitem__, ['a', 'd'])
- def test_icol(self):
- # 10711 deprecated
+ def test_iloc(self):
# 2227
result = self.frame.iloc[:, 0]