Skip to content

Commit aa89c32

Browse files
Merge remote-tracking branch 'upstream/main' into string-dtype-object-conversion
2 parents 7b73c04 + 0851ac3 commit aa89c32

24 files changed

+328
-349
lines changed

ci/code_checks.sh

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,10 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
158158
-i "pandas.Series.sparse.sp_values SA01" \
159159
-i "pandas.Series.sparse.to_coo PR07,RT03,SA01" \
160160
-i "pandas.Series.std PR01,RT03,SA01" \
161-
-i "pandas.Series.str.lstrip RT03" \
162161
-i "pandas.Series.str.match RT03" \
163162
-i "pandas.Series.str.normalize RT03,SA01" \
164-
-i "pandas.Series.str.partition RT03" \
165163
-i "pandas.Series.str.repeat SA01" \
166164
-i "pandas.Series.str.replace SA01" \
167-
-i "pandas.Series.str.rpartition RT03" \
168-
-i "pandas.Series.str.rstrip RT03" \
169-
-i "pandas.Series.str.strip RT03" \
170165
-i "pandas.Series.str.wrap RT03,SA01" \
171166
-i "pandas.Series.str.zfill RT03" \
172167
-i "pandas.Series.struct.dtypes SA01" \
@@ -221,9 +216,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
221216
-i "pandas.Timestamp.today SA01" \
222217
-i "pandas.Timestamp.toordinal SA01" \
223218
-i "pandas.Timestamp.tzinfo GL08" \
224-
-i "pandas.Timestamp.unit SA01" \
225-
-i "pandas.Timestamp.utcoffset SA01" \
226-
-i "pandas.Timestamp.utctimetuple SA01" \
227219
-i "pandas.Timestamp.value GL08" \
228220
-i "pandas.Timestamp.year GL08" \
229221
-i "pandas.api.extensions.ExtensionArray._pad_or_backfill PR01,RT03,SA01" \
@@ -247,7 +239,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
247239
-i "pandas.api.extensions.ExtensionArray.view SA01" \
248240
-i "pandas.api.interchange.from_dataframe RT03,SA01" \
249241
-i "pandas.api.types.is_bool PR01,SA01" \
250-
-i "pandas.api.types.is_bool_dtype SA01" \
251242
-i "pandas.api.types.is_categorical_dtype SA01" \
252243
-i "pandas.api.types.is_complex PR01,SA01" \
253244
-i "pandas.api.types.is_complex_dtype SA01" \
@@ -409,7 +400,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
409400
-i "pandas.set_eng_float_format RT03,SA01" \
410401
-i "pandas.testing.assert_extension_array_equal SA01" \
411402
-i "pandas.tseries.offsets.BDay PR02,SA01" \
412-
-i "pandas.tseries.offsets.BQuarterBegin PR02" \
413403
-i "pandas.tseries.offsets.BQuarterBegin.freqstr SA01" \
414404
-i "pandas.tseries.offsets.BQuarterBegin.is_on_offset GL08" \
415405
-i "pandas.tseries.offsets.BQuarterBegin.n GL08" \
@@ -431,7 +421,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
431421
-i "pandas.tseries.offsets.BYearBegin.nanos GL08" \
432422
-i "pandas.tseries.offsets.BYearBegin.normalize GL08" \
433423
-i "pandas.tseries.offsets.BYearBegin.rule_code GL08" \
434-
-i "pandas.tseries.offsets.BYearEnd PR02" \
435424
-i "pandas.tseries.offsets.BYearEnd.freqstr SA01" \
436425
-i "pandas.tseries.offsets.BYearEnd.is_on_offset GL08" \
437426
-i "pandas.tseries.offsets.BYearEnd.month GL08" \
@@ -520,7 +509,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
520509
-i "pandas.tseries.offsets.CustomBusinessMonthEnd.normalize GL08" \
521510
-i "pandas.tseries.offsets.CustomBusinessMonthEnd.rule_code GL08" \
522511
-i "pandas.tseries.offsets.CustomBusinessMonthEnd.weekmask GL08" \
523-
-i "pandas.tseries.offsets.DateOffset PR02" \
524512
-i "pandas.tseries.offsets.DateOffset.freqstr SA01" \
525513
-i "pandas.tseries.offsets.DateOffset.is_on_offset GL08" \
526514
-i "pandas.tseries.offsets.DateOffset.n GL08" \
@@ -533,14 +521,12 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
533521
-i "pandas.tseries.offsets.Day.nanos SA01" \
534522
-i "pandas.tseries.offsets.Day.normalize GL08" \
535523
-i "pandas.tseries.offsets.Day.rule_code GL08" \
536-
-i "pandas.tseries.offsets.Easter PR02" \
537524
-i "pandas.tseries.offsets.Easter.freqstr SA01" \
538525
-i "pandas.tseries.offsets.Easter.is_on_offset GL08" \
539526
-i "pandas.tseries.offsets.Easter.n GL08" \
540527
-i "pandas.tseries.offsets.Easter.nanos GL08" \
541528
-i "pandas.tseries.offsets.Easter.normalize GL08" \
542529
-i "pandas.tseries.offsets.Easter.rule_code GL08" \
543-
-i "pandas.tseries.offsets.FY5253 PR02" \
544530
-i "pandas.tseries.offsets.FY5253.freqstr SA01" \
545531
-i "pandas.tseries.offsets.FY5253.get_rule_code_suffix GL08" \
546532
-i "pandas.tseries.offsets.FY5253.get_year_end GL08" \
@@ -552,7 +538,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
552538
-i "pandas.tseries.offsets.FY5253.startingMonth GL08" \
553539
-i "pandas.tseries.offsets.FY5253.variation GL08" \
554540
-i "pandas.tseries.offsets.FY5253.weekday GL08" \
555-
-i "pandas.tseries.offsets.FY5253Quarter PR02" \
556541
-i "pandas.tseries.offsets.FY5253Quarter.freqstr SA01" \
557542
-i "pandas.tseries.offsets.FY5253Quarter.get_rule_code_suffix GL08" \
558543
-i "pandas.tseries.offsets.FY5253Quarter.get_weeks GL08" \
@@ -566,14 +551,13 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
566551
-i "pandas.tseries.offsets.FY5253Quarter.variation GL08" \
567552
-i "pandas.tseries.offsets.FY5253Quarter.weekday GL08" \
568553
-i "pandas.tseries.offsets.FY5253Quarter.year_has_extra_week GL08" \
569-
-i "pandas.tseries.offsets.Hour PR02" \
570554
-i "pandas.tseries.offsets.Hour.freqstr SA01" \
571555
-i "pandas.tseries.offsets.Hour.is_on_offset GL08" \
572556
-i "pandas.tseries.offsets.Hour.n GL08" \
573557
-i "pandas.tseries.offsets.Hour.nanos SA01" \
574558
-i "pandas.tseries.offsets.Hour.normalize GL08" \
575559
-i "pandas.tseries.offsets.Hour.rule_code GL08" \
576-
-i "pandas.tseries.offsets.LastWeekOfMonth PR02,SA01" \
560+
-i "pandas.tseries.offsets.LastWeekOfMonth SA01" \
577561
-i "pandas.tseries.offsets.LastWeekOfMonth.freqstr SA01" \
578562
-i "pandas.tseries.offsets.LastWeekOfMonth.is_on_offset GL08" \
579563
-i "pandas.tseries.offsets.LastWeekOfMonth.n GL08" \
@@ -582,28 +566,24 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
582566
-i "pandas.tseries.offsets.LastWeekOfMonth.rule_code GL08" \
583567
-i "pandas.tseries.offsets.LastWeekOfMonth.week GL08" \
584568
-i "pandas.tseries.offsets.LastWeekOfMonth.weekday GL08" \
585-
-i "pandas.tseries.offsets.Micro PR02" \
586569
-i "pandas.tseries.offsets.Micro.freqstr SA01" \
587570
-i "pandas.tseries.offsets.Micro.is_on_offset GL08" \
588571
-i "pandas.tseries.offsets.Micro.n GL08" \
589572
-i "pandas.tseries.offsets.Micro.nanos SA01" \
590573
-i "pandas.tseries.offsets.Micro.normalize GL08" \
591574
-i "pandas.tseries.offsets.Micro.rule_code GL08" \
592-
-i "pandas.tseries.offsets.Milli PR02" \
593575
-i "pandas.tseries.offsets.Milli.freqstr SA01" \
594576
-i "pandas.tseries.offsets.Milli.is_on_offset GL08" \
595577
-i "pandas.tseries.offsets.Milli.n GL08" \
596578
-i "pandas.tseries.offsets.Milli.nanos SA01" \
597579
-i "pandas.tseries.offsets.Milli.normalize GL08" \
598580
-i "pandas.tseries.offsets.Milli.rule_code GL08" \
599-
-i "pandas.tseries.offsets.Minute PR02" \
600581
-i "pandas.tseries.offsets.Minute.freqstr SA01" \
601582
-i "pandas.tseries.offsets.Minute.is_on_offset GL08" \
602583
-i "pandas.tseries.offsets.Minute.n GL08" \
603584
-i "pandas.tseries.offsets.Minute.nanos SA01" \
604585
-i "pandas.tseries.offsets.Minute.normalize GL08" \
605586
-i "pandas.tseries.offsets.Minute.rule_code GL08" \
606-
-i "pandas.tseries.offsets.MonthBegin PR02" \
607587
-i "pandas.tseries.offsets.MonthBegin.freqstr SA01" \
608588
-i "pandas.tseries.offsets.MonthBegin.is_on_offset GL08" \
609589
-i "pandas.tseries.offsets.MonthBegin.n GL08" \
@@ -616,14 +596,12 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
616596
-i "pandas.tseries.offsets.MonthEnd.nanos GL08" \
617597
-i "pandas.tseries.offsets.MonthEnd.normalize GL08" \
618598
-i "pandas.tseries.offsets.MonthEnd.rule_code GL08" \
619-
-i "pandas.tseries.offsets.Nano PR02" \
620599
-i "pandas.tseries.offsets.Nano.freqstr SA01" \
621600
-i "pandas.tseries.offsets.Nano.is_on_offset GL08" \
622601
-i "pandas.tseries.offsets.Nano.n GL08" \
623602
-i "pandas.tseries.offsets.Nano.nanos SA01" \
624603
-i "pandas.tseries.offsets.Nano.normalize GL08" \
625604
-i "pandas.tseries.offsets.Nano.rule_code GL08" \
626-
-i "pandas.tseries.offsets.QuarterBegin PR02" \
627605
-i "pandas.tseries.offsets.QuarterBegin.freqstr SA01" \
628606
-i "pandas.tseries.offsets.QuarterBegin.is_on_offset GL08" \
629607
-i "pandas.tseries.offsets.QuarterBegin.n GL08" \
@@ -638,14 +616,13 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
638616
-i "pandas.tseries.offsets.QuarterEnd.normalize GL08" \
639617
-i "pandas.tseries.offsets.QuarterEnd.rule_code GL08" \
640618
-i "pandas.tseries.offsets.QuarterEnd.startingMonth GL08" \
641-
-i "pandas.tseries.offsets.Second PR02" \
642619
-i "pandas.tseries.offsets.Second.freqstr SA01" \
643620
-i "pandas.tseries.offsets.Second.is_on_offset GL08" \
644621
-i "pandas.tseries.offsets.Second.n GL08" \
645622
-i "pandas.tseries.offsets.Second.nanos SA01" \
646623
-i "pandas.tseries.offsets.Second.normalize GL08" \
647624
-i "pandas.tseries.offsets.Second.rule_code GL08" \
648-
-i "pandas.tseries.offsets.SemiMonthBegin PR02,SA01" \
625+
-i "pandas.tseries.offsets.SemiMonthBegin SA01" \
649626
-i "pandas.tseries.offsets.SemiMonthBegin.day_of_month GL08" \
650627
-i "pandas.tseries.offsets.SemiMonthBegin.freqstr SA01" \
651628
-i "pandas.tseries.offsets.SemiMonthBegin.is_on_offset GL08" \
@@ -668,15 +645,14 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
668645
-i "pandas.tseries.offsets.Tick.nanos SA01" \
669646
-i "pandas.tseries.offsets.Tick.normalize GL08" \
670647
-i "pandas.tseries.offsets.Tick.rule_code GL08" \
671-
-i "pandas.tseries.offsets.Week PR02" \
672648
-i "pandas.tseries.offsets.Week.freqstr SA01" \
673649
-i "pandas.tseries.offsets.Week.is_on_offset GL08" \
674650
-i "pandas.tseries.offsets.Week.n GL08" \
675651
-i "pandas.tseries.offsets.Week.nanos GL08" \
676652
-i "pandas.tseries.offsets.Week.normalize GL08" \
677653
-i "pandas.tseries.offsets.Week.rule_code GL08" \
678654
-i "pandas.tseries.offsets.Week.weekday GL08" \
679-
-i "pandas.tseries.offsets.WeekOfMonth PR02,SA01" \
655+
-i "pandas.tseries.offsets.WeekOfMonth SA01" \
680656
-i "pandas.tseries.offsets.WeekOfMonth.freqstr SA01" \
681657
-i "pandas.tseries.offsets.WeekOfMonth.is_on_offset GL08" \
682658
-i "pandas.tseries.offsets.WeekOfMonth.n GL08" \

doc/source/whatsnew/v3.0.0.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ Other enhancements
5353
- :meth:`pandas.concat` will raise a ``ValueError`` when ``ignore_index=True`` and ``keys`` is not ``None`` (:issue:`59274`)
5454
- Multiplying two :class:`DateOffset` objects will now raise a ``TypeError`` instead of a ``RecursionError`` (:issue:`59442`)
5555
- Restore support for reading Stata 104-format and enable reading 103-format dta files (:issue:`58554`)
56+
- Support passing a :class:`Iterable[Hashable]` input to :meth:`DataFrame.drop_duplicates` (:issue:`59237`)
5657
- Support reading Stata 102-format (Stata 1) dta files (:issue:`58978`)
5758
- Support reading Stata 110-format (Stata 7) dta files (:issue:`47176`)
5859

@@ -667,6 +668,7 @@ ExtensionArray
667668
^^^^^^^^^^^^^^
668669
- Bug in :meth:`.arrays.ArrowExtensionArray.__setitem__` which caused wrong behavior when using an integer array with repeated values as a key (:issue:`58530`)
669670
- Bug in :meth:`api.types.is_datetime64_any_dtype` where a custom :class:`ExtensionDtype` would return ``False`` for array-likes (:issue:`57055`)
671+
- Bug in comparison between object with :class:`ArrowDtype` and incompatible-dtyped (e.g. string vs bool) incorrectly raising instead of returning all-``False`` (for ``==``) or all-``True`` (for ``!=``) (:issue:`59505`)
670672
- Bug in various :class:`DataFrame` reductions for pyarrow temporal dtypes returning incorrect dtype when result was null (:issue:`59234`)
671673

672674
Styler

pandas/_libs/tslibs/nattype.pyx

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,24 @@ class NaTType(_NaT):
595595
utctimetuple = _make_error_func(
596596
"utctimetuple",
597597
"""
598-
Return UTC time tuple, compatible with time.localtime().
598+
Return UTC time tuple, compatible with `time.localtime()`.
599+
600+
This method converts the Timestamp to UTC and returns a time tuple
601+
containing 9 components: year, month, day, hour, minute, second,
602+
weekday, day of year, and DST flag. This is particularly useful for
603+
converting a Timestamp to a format compatible with time module functions.
604+
605+
Returns
606+
-------
607+
time.struct_time
608+
A time.struct_time object representing the UTC time.
609+
610+
See Also
611+
--------
612+
datetime.datetime.utctimetuple :
613+
Return UTC time tuple, compatible with time.localtime().
614+
Timestamp.timetuple : Return time tuple of local time.
615+
time.struct_time : Time tuple structure used by time functions.
599616
600617
Examples
601618
--------
@@ -612,6 +629,22 @@ class NaTType(_NaT):
612629
"""
613630
Return utc offset.
614631
632+
This method returns the difference between UTC and the local time
633+
as a `timedelta` object. It is useful for understanding the time
634+
difference between the current timezone and UTC.
635+
636+
Returns
637+
--------
638+
timedelta
639+
The difference between UTC and the local time as a `timedelta` object.
640+
641+
See Also
642+
--------
643+
datetime.datetime.utcoffset :
644+
Standard library method to get the UTC offset of a datetime object.
645+
Timestamp.tzname : Return the name of the timezone.
646+
Timestamp.dst : Return the daylight saving time (DST) adjustment.
647+
615648
Examples
616649
--------
617650
>>> ts = pd.Timestamp('2023-01-01 10:00:00', tz='Europe/Brussels')

0 commit comments

Comments
 (0)