Skip to content

Commit 6ce0c74

Browse files
committed
ENH: Support for list of formats in pd.to_datetime() (pandas-dev#55226) pandas-dev#55698
1 parent 049f3d3 commit 6ce0c74

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

pandas/core/tools/datetimes.py

-1
Original file line numberDiff line numberDiff line change
@@ -1145,7 +1145,6 @@ def to_datetime(
11451145
if not cache_array.empty:
11461146
result = _convert_and_box_cache(argc, cache_array)
11471147
else:
1148-
11491148
#CHANGED HERE
11501149
if isinstance(format, (list, tuple)):
11511150
format = np.array(format, dtype="O")

pandas/tests/tools/test_to_datetime.py

+1
Original file line numberDiff line numberDiff line change
@@ -1095,6 +1095,7 @@ def test_to_datetime_now_with_format(self, format, expected_ds, string, attribut
10951095
#CHANGED HERE
10961096
def test_to_datetime_where_formart_is_list(self):
10971097
# https://github.com/pandas-dev/pandas/issues/55226
1098+
10981099
data = ['2023-10-12','2023-10-13 14:30:00']
10991100
all_formats = ['%Y-m-%d','%Y-%m-%d %H:%M:%S']
11001101
result = to_datetime(data,format=all_formats)

0 commit comments

Comments
 (0)