File tree Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 22missing types & inference
33"""
44import numpy as np
5+ import warnings
6+
57from pandas ._libs import lib
68from pandas ._libs .tslib import NaT , iNaT
79from .generic import (ABCMultiIndex , ABCSeries ,
@@ -401,3 +403,16 @@ def remove_na_arraylike(arr):
401403 Return array-like containing only true/non-NaN values, possibly empty.
402404 """
403405 return arr [notnull (lib .values_from_object (arr ))]
406+
407+
408+ # see gh-16971
409+ def remove_na (arr ):
410+ """
411+ DEPRECATED : this function will be removed in a future version.
412+
413+ Alias to `remove_na_arraylike` for `seaborn` compatibility.
414+ """
415+
416+ warnings .warn ("remove_na is deprecated. Use remove_na_arraylike instead." ,
417+ FutureWarning , stacklevel = 2 )
418+ return remove_na_arraylike (arr )
Original file line number Diff line number Diff line change 3838 maybe_cast_to_datetime , maybe_castable )
3939from pandas .core .dtypes .missing import isnull , notnull , remove_na_arraylike
4040
41+ # see gh-16971
42+ from pandas .core .dtypes .missing import remove_na # noqa
43+
4144from pandas .core .common import (is_bool_indexer ,
4245 _default_index ,
4346 _asarray_tuplesafe ,
Original file line number Diff line number Diff line change 1414from pandas .core .dtypes .dtypes import DatetimeTZDtype
1515from pandas .core .dtypes .missing import (
1616 array_equivalent , isnull , notnull ,
17- na_value_for_dtype )
17+ na_value_for_dtype , remove_na )
18+
19+
20+ def test_remove_na_deprecation ():
21+ # see gh-16971
22+ with tm .assert_produces_warning (FutureWarning ):
23+ remove_na (Series ([]))
1824
1925
2026def test_notnull ():
You can’t perform that action at this time.
0 commit comments