Skip to content

Commit 4eb66ab

Browse files
committed
Merge branch 'inde_api_deprecated_is_categorical' of https://github.com/ShisuiUzumaki/pandas into inde_api_deprecated_is_categorical
2 parents 255285b + 008951d commit 4eb66ab

File tree

2 files changed

+7
-39
lines changed

2 files changed

+7
-39
lines changed

doc/source/whatsnew/v2.0.0.rst

-32
Original file line numberDiff line numberDiff line change
@@ -411,38 +411,6 @@ Optional libraries below the lowest tested version may still work, but are not c
411411

412412
See :ref:`install.dependencies` and :ref:`install.optional_dependencies` for more.
413413

414-
Datetimes are now parsed with a consistent format
415-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
416-
417-
In the past, :func:`to_datetime` guessed the format for each element independently. This was appropriate for some cases where elements had mixed date formats - however, it would regularly cause problems when users expected a consistent format but the function would switch formats between elements. As of version 2.0.0, parsing will use a consistent format, determined by the first non-NA value (unless the user specifies a format, in which case that is used).
418-
419-
*Old behavior*:
420-
421-
.. code-block:: ipython
422-
423-
In [1]: ser = pd.Series(['13-01-2000', '12-01-2000'])
424-
In [2]: pd.to_datetime(ser)
425-
Out[2]:
426-
0 2000-01-13
427-
1 2000-12-01
428-
dtype: datetime64[ns]
429-
430-
*New behavior*:
431-
432-
.. ipython:: python
433-
:okwarning:
434-
435-
ser = pd.Series(['13-01-2000', '12-01-2000'])
436-
pd.to_datetime(ser)
437-
438-
Note that this affects :func:`read_csv` as well.
439-
440-
If you still need to parse dates with inconsistent formats, you'll need to apply :func:`to_datetime`
441-
to each element individually, e.g. ::
442-
443-
ser = pd.Series(['13-01-2000', '12 January 2000'])
444-
ser.apply(pd.to_datetime)
445-
446414
.. _whatsnew_200.api_breaking.other:
447415

448416
Other API changes

pandas/core/indexes/base.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -2943,7 +2943,7 @@ def union(self, other, sort=None):
29432943
29442944
Returns
29452945
-------
2946-
union : Index
2946+
Index
29472947
29482948
Examples
29492949
--------
@@ -3284,7 +3284,7 @@ def difference(self, other, sort=None):
32843284
32853285
Returns
32863286
-------
3287-
difference : Index
3287+
Index
32883288
32893289
Examples
32903290
--------
@@ -3360,7 +3360,7 @@ def symmetric_difference(self, other, result_name=None, sort=None):
33603360
33613361
Returns
33623362
-------
3363-
symmetric_difference : Index
3363+
Index
33643364
33653365
Notes
33663366
-----
@@ -3448,7 +3448,7 @@ def get_loc(self, key):
34483448
34493449
Returns
34503450
-------
3451-
loc : int if unique index, slice if monotonic index, else mask
3451+
int if unique index, slice if monotonic index, else mask
34523452
34533453
Examples
34543454
--------
@@ -3509,7 +3509,7 @@ def get_loc(self, key):
35093509
35103510
Returns
35113511
-------
3512-
indexer : np.ndarray[np.intp]
3512+
np.ndarray[np.intp]
35133513
Integers from 0 to n - 1 indicating that the index at these
35143514
positions matches the corresponding target values. Missing values
35153515
in the target are marked by -1.
@@ -6132,7 +6132,7 @@ def slice_indexer(
61326132
61336133
Returns
61346134
-------
6135-
indexer : slice
6135+
slice
61366136
61376137
Raises
61386138
------
@@ -6309,7 +6309,7 @@ def slice_locs(self, start=None, end=None, step=None) -> tuple[int, int]:
63096309
63106310
Returns
63116311
-------
6312-
start, end : int
6312+
tuple[int, int]
63136313
63146314
See Also
63156315
--------

0 commit comments

Comments
 (0)