Skip to content

Commit 391a43b

Browse files
committed
move union_categoricals to pandas.api.types
1 parent 2f748d2 commit 391a43b

File tree

5 files changed

+7
-4
lines changed

5 files changed

+7
-4
lines changed

doc/source/categorical.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ will be the union of the categories being combined.
673673

674674
.. ipython:: python
675675
676-
from pandas.types.concat import union_categoricals
676+
from pandas.api.types import union_categoricals
677677
a = pd.Categorical(["b", "c"])
678678
b = pd.Categorical(["a", "b"])
679679
union_categoricals([a, b])

doc/source/whatsnew/v0.20.0.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ Other Enhancements
488488
- HTML table output skips ``colspan`` or ``rowspan`` attribute if equal to 1. (:issue:`15403`)
489489

490490
- ``TimedeltaIndex`` now has a custom datetick formatter specifically designed for nanosecond level precision (:issue:`8711`)
491-
- ``pd.types.concat.union_categoricals`` gained the ``ignore_ordered`` argument to allow ignoring the ordered attribute of unioned categoricals (:issue:`13410`). See the :ref:`categorical union docs <categorical.union>` for more information.
491+
- ``pd.api.types.union_categoricals`` gained the ``ignore_ordered`` argument to allow ignoring the ordered attribute of unioned categoricals (:issue:`13410`). See the :ref:`categorical union docs <categorical.union>` for more information.
492492
- ``DataFrame.to_latex()`` and ``DataFrame.to_string()`` now allow optional header aliases. (:issue:`15536`)
493493
- Re-enable the ``parse_dates`` keyword of ``pd.read_excel()`` to parse string columns as dates (:issue:`14326`)
494494
- Added ``.empty`` property to subclasses of ``Index``. (:issue:`15270`)
@@ -1031,6 +1031,8 @@ If indicated, a deprecation warning will be issued if you reference that module.
10311031
"pandas._hash", "pandas.tools.libhash", ""
10321032
"pandas._window", "pandas.core.libwindow", ""
10331033

1034+
- The function :func:`~pandas.api.type.union_categoricals` is now importable from ``pandas.api.types``, formerly from ``pandas.types.concat`` (:issue:`15998`)
1035+
10341036
.. _whatsnew_0200.api_breaking.sort_index:
10351037

10361038
DataFrame.sort_index changes

pandas/api/types/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
""" public toolkit API """
22

33
from pandas.core.typed.api import * # noqa
4+
from pandas.core.typed.concat import union_categoricals # noqa
45
del np # noqa

pandas/core/algorithms.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
from pandas.compat.numpy import _np_version_under1p10
2929
from pandas.core.typed.missing import isnull
3030

31-
import pandas.core.common as com
31+
from pandas.core import common as com
3232
from pandas.compat import string_types
3333
from pandas._libs import algos, lib, hashtable as htable
3434
from pandas._libs.tslib import iNaT

pandas/tests/api/test_types.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class TestTypes(Base, tm.TestCase):
3030
'is_dict_like', 'is_iterator', 'is_file_like',
3131
'is_list_like', 'is_hashable',
3232
'is_named_tuple', 'is_sequence',
33-
'pandas_dtype']
33+
'pandas_dtype', 'union_categoricals']
3434

3535
def test_types(self):
3636

0 commit comments

Comments
 (0)