diff --git a/pandas/core/series.py b/pandas/core/series.py index 4d5b718ce0ae9..219eca4277f32 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -37,7 +37,6 @@ maybe_convert_platform, maybe_cast_to_datetime, maybe_castable) from pandas.core.dtypes.missing import isnull, notnull, remove_na_arraylike - from pandas.core.common import (is_bool_indexer, _default_index, _asarray_tuplesafe, @@ -88,6 +87,17 @@ versionadded_to_excel='\n .. versionadded:: 0.20.0\n') +# see gh-16971 +def remove_na(arr): + """ + DEPRECATED : this function will be removed in a future version. + """ + + warnings.warn("remove_na is deprecated and is a private " + "function. Do not use.", FutureWarning, stacklevel=2) + return remove_na_arraylike(arr) + + def _coerce_method(converter): """ install the scalar coercion methods """ diff --git a/pandas/tests/series/test_missing.py b/pandas/tests/series/test_missing.py index 8e73c17684a16..b5948e75aa73e 100644 --- a/pandas/tests/series/test_missing.py +++ b/pandas/tests/series/test_missing.py @@ -15,6 +15,7 @@ MultiIndex, Index, Timestamp, NaT, IntervalIndex) from pandas.compat import range from pandas._libs.tslib import iNaT +from pandas.core.series import remove_na from pandas.util.testing import assert_series_equal, assert_frame_equal import pandas.util.testing as tm @@ -50,6 +51,11 @@ def _simple_ts(start, end, freq='D'): class TestSeriesMissingData(TestData): + def test_remove_na_deprecation(self): + # see gh-16971 + with tm.assert_produces_warning(FutureWarning): + remove_na(Series([])) + def test_timedelta_fillna(self): # GH 3371 s = Series([Timestamp('20130101'), Timestamp('20130101'), Timestamp(