Skip to content

Commit ac7d240

Browse files
Add my note + add type hint
1 parent 5b024e8 commit ac7d240

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

doc/source/whatsnew/v3.0.0.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,6 +1274,7 @@ Other
12741274
- Fixed bug in the :meth:`Series.rank` with object dtype and extremely small float values (:issue:`62036`)
12751275
- Fixed bug where the :class:`DataFrame` constructor misclassified array-like objects with a ``.name`` attribute as :class:`Series` or :class:`Index` (:issue:`61443`)
12761276
- Fixed regression in :meth:`DataFrame.from_records` not initializing subclasses properly (:issue:`57008`)
1277+
- Fixed bug when parsing datetime array formatting in :func:`_guess_datetime_format_for_array` where the format string was based on the first item and not the entire series of entered dates
12771278

12781279
.. ***DO NOT USE THIS SECTION***
12791280

pandas/core/tools/datetimes.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,9 @@ class FulldatetimeDict(YearMonthDayDict, total=False):
129129
# ---------------------------------------------------------------------
130130

131131

132-
def _guess_datetime_format_for_array(arr, dayfirst: bool | None = False) -> str | None:
132+
def _guess_datetime_format_for_array(
133+
arr: np.ndarray, dayfirst: bool | None = False
134+
) -> str | None:
133135
# Try to guess the format based on the first non-NaN element, return None if can't
134136
search_start = 0
135137
allowed_formats = set()

0 commit comments

Comments
 (0)