Skip to content

Commit 186b215

Browse files
committed
Merge remote-tracking branch 'upstream/master' into fix_resource_warn
2 parents 488d767 + f492be6 commit 186b215

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+947
-905
lines changed

doc/source/whatsnew/v0.24.0.rst

+1
Original file line numberDiff line numberDiff line change
@@ -1591,6 +1591,7 @@ Other
15911591
- Logical operations ``&, |, ^`` between :class:`Series` and :class:`Index` will no longer raise ``ValueError`` (:issue:`22092`)
15921592
- Checking PEP 3141 numbers in :func:`~pandas.api.types.is_scalar` function returns ``True`` (:issue:`22903`)
15931593
- Bug in :meth:`DataFrame.combine_first` in which column types were unexpectedly converted to float (:issue:`20699`)
1594+
- Bug where C variables were declared with external linkage causing import errors if certain other C libraries were imported before Pandas. (:issue:`24113`)
15941595

15951596
.. _whatsnew_0.24.0.contributors:
15961597

pandas/core/algorithms.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,11 @@ def unique(values):
289289
- If the input is a Categorical dtype, the return is a Categorical
290290
- If the input is a Series/ndarray, the return will be an ndarray
291291
292+
See Also
293+
--------
294+
pandas.Index.unique
295+
pandas.Series.unique
296+
292297
Examples
293298
--------
294299
>>> pd.unique(pd.Series([2, 1, 3, 3]))
@@ -338,11 +343,6 @@ def unique(values):
338343
339344
>>> pd.unique([('a', 'b'), ('b', 'a'), ('a', 'c'), ('b', 'a')])
340345
array([('a', 'b'), ('b', 'a'), ('a', 'c')], dtype=object)
341-
342-
See Also
343-
--------
344-
pandas.Index.unique
345-
pandas.Series.unique
346346
"""
347347

348348
values = _ensure_arraylike(values)

pandas/core/arrays/categorical.py

+38-38
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,16 @@ class Categorical(ExtensionArray, PandasObject):
273273
If an explicit ``ordered=True`` is given but no `categories` and the
274274
`values` are not sortable.
275275
276+
See Also
277+
--------
278+
pandas.api.types.CategoricalDtype : Type for categorical data.
279+
CategoricalIndex : An Index with an underlying ``Categorical``.
280+
281+
Notes
282+
-----
283+
See the `user guide
284+
<http://pandas.pydata.org/pandas-docs/stable/categorical.html>`_ for more.
285+
276286
Examples
277287
--------
278288
>>> pd.Categorical([1, 2, 3, 1, 2, 3])
@@ -293,16 +303,6 @@ class Categorical(ExtensionArray, PandasObject):
293303
Categories (3, object): [c < b < a]
294304
>>> c.min()
295305
'c'
296-
297-
Notes
298-
-----
299-
See the `user guide
300-
<http://pandas.pydata.org/pandas-docs/stable/categorical.html>`_ for more.
301-
302-
See Also
303-
--------
304-
pandas.api.types.CategoricalDtype : Type for categorical data.
305-
CategoricalIndex : An Index with an underlying ``Categorical``.
306306
"""
307307

308308
# For comparisons, so that numpy uses our implementation if the compare
@@ -827,11 +827,6 @@ def set_categories(self, new_categories, ordered=None, rename=False,
827827
dtypes on python3, which does not considers a S1 string equal to a
828828
single char python string.
829829
830-
Raises
831-
------
832-
ValueError
833-
If new_categories does not validate as categories
834-
835830
Parameters
836831
----------
837832
new_categories : Index-like
@@ -850,6 +845,11 @@ def set_categories(self, new_categories, ordered=None, rename=False,
850845
-------
851846
cat : Categorical with reordered categories or None if inplace.
852847
848+
Raises
849+
------
850+
ValueError
851+
If new_categories does not validate as categories
852+
853853
See Also
854854
--------
855855
rename_categories
@@ -882,12 +882,6 @@ def rename_categories(self, new_categories, inplace=False):
882882
"""
883883
Renames categories.
884884
885-
Raises
886-
------
887-
ValueError
888-
If new categories are list-like and do not have the same number of
889-
items than the current categories or do not validate as categories
890-
891885
Parameters
892886
----------
893887
new_categories : list-like, dict-like or callable
@@ -922,6 +916,12 @@ def rename_categories(self, new_categories, inplace=False):
922916
With ``inplace=False``, the new categorical is returned.
923917
With ``inplace=True``, there is no return value.
924918
919+
Raises
920+
------
921+
ValueError
922+
If new categories are list-like and do not have the same number of
923+
items than the current categories or do not validate as categories
924+
925925
See Also
926926
--------
927927
reorder_categories
@@ -979,12 +979,6 @@ def reorder_categories(self, new_categories, ordered=None, inplace=False):
979979
`new_categories` need to include all old categories and no new category
980980
items.
981981
982-
Raises
983-
------
984-
ValueError
985-
If the new categories do not contain all old category items or any
986-
new ones
987-
988982
Parameters
989983
----------
990984
new_categories : Index-like
@@ -1000,6 +994,12 @@ def reorder_categories(self, new_categories, ordered=None, inplace=False):
1000994
-------
1001995
cat : Categorical with reordered categories or None if inplace.
1002996
997+
Raises
998+
------
999+
ValueError
1000+
If the new categories do not contain all old category items or any
1001+
new ones
1002+
10031003
See Also
10041004
--------
10051005
rename_categories
@@ -1022,12 +1022,6 @@ def add_categories(self, new_categories, inplace=False):
10221022
`new_categories` will be included at the last/highest place in the
10231023
categories and will be unused directly after this call.
10241024
1025-
Raises
1026-
------
1027-
ValueError
1028-
If the new categories include old categories or do not validate as
1029-
categories
1030-
10311025
Parameters
10321026
----------
10331027
new_categories : category or list-like of category
@@ -1040,6 +1034,12 @@ def add_categories(self, new_categories, inplace=False):
10401034
-------
10411035
cat : Categorical with new categories added or None if inplace.
10421036
1037+
Raises
1038+
------
1039+
ValueError
1040+
If the new categories include old categories or do not validate as
1041+
categories
1042+
10431043
See Also
10441044
--------
10451045
rename_categories
@@ -1072,11 +1072,6 @@ def remove_categories(self, removals, inplace=False):
10721072
`removals` must be included in the old categories. Values which were in
10731073
the removed categories will be set to NaN
10741074
1075-
Raises
1076-
------
1077-
ValueError
1078-
If the removals are not contained in the categories
1079-
10801075
Parameters
10811076
----------
10821077
removals : category or list of categories
@@ -1089,6 +1084,11 @@ def remove_categories(self, removals, inplace=False):
10891084
-------
10901085
cat : Categorical with removed categories or None if inplace.
10911086
1087+
Raises
1088+
------
1089+
ValueError
1090+
If the removals are not contained in the categories
1091+
10921092
See Also
10931093
--------
10941094
rename_categories

pandas/core/arrays/datetimes.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -892,6 +892,11 @@ def to_period(self, freq=None):
892892
When converting a DatetimeArray/Index with non-regular values,
893893
so that a frequency cannot be inferred.
894894
895+
See Also
896+
--------
897+
PeriodIndex: Immutable ndarray holding ordinal values.
898+
DatetimeIndex.to_pydatetime: Return DatetimeIndex as object.
899+
895900
Examples
896901
--------
897902
>>> df = pd.DataFrame({"y": [1,2,3]},
@@ -908,11 +913,6 @@ def to_period(self, freq=None):
908913
>>> idx.to_period()
909914
PeriodIndex(['2017-01-01', '2017-01-02'],
910915
dtype='period[D]', freq='D')
911-
912-
See Also
913-
--------
914-
PeriodIndex: Immutable ndarray holding ordinal values.
915-
DatetimeIndex.to_pydatetime: Return DatetimeIndex as object.
916916
"""
917917
from pandas.core.arrays import PeriodArray
918918

@@ -1087,17 +1087,17 @@ def date(self):
10871087
by 6. This method is available on both Series with datetime
10881088
values (using the `dt` accessor) or DatetimeIndex.
10891089
1090+
Returns
1091+
-------
1092+
Series or Index
1093+
Containing integers indicating the day number.
1094+
10901095
See Also
10911096
--------
10921097
Series.dt.dayofweek : Alias.
10931098
Series.dt.weekday : Alias.
10941099
Series.dt.day_name : Returns the name of the day of the week.
10951100
1096-
Returns
1097-
-------
1098-
Series or Index
1099-
Containing integers indicating the day number.
1100-
11011101
Examples
11021102
--------
11031103
>>> s = pd.date_range('2016-12-31', '2017-01-08', freq='D').to_series()

0 commit comments

Comments
 (0)