File tree 1 file changed +11
-3
lines changed
1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 66
66
)
67
67
from pandas .core .dtypes .missing import isna
68
68
69
- from pandas import StringDtype
69
+ from pandas import (
70
+ DatetimeIndex ,
71
+ StringDtype ,
72
+ )
70
73
from pandas .core import algorithms
71
74
from pandas .core .arrays import (
72
75
ArrowExtensionArray ,
@@ -1115,14 +1118,19 @@ def converter(*date_cols, col: Hashable):
1115
1118
date_format .get (col ) if isinstance (date_format , dict ) else date_format
1116
1119
)
1117
1120
1118
- return tools .to_datetime (
1121
+ result = tools .to_datetime (
1119
1122
ensure_object (strs ),
1120
1123
format = date_fmt ,
1121
1124
utc = False ,
1122
1125
dayfirst = dayfirst ,
1123
1126
errors = "ignore" ,
1124
1127
cache = cache_dates ,
1125
- )._values
1128
+ )
1129
+ if isinstance (result , DatetimeIndex ):
1130
+ arr = result .to_numpy ()
1131
+ arr .flags .writeable = True
1132
+ return arr
1133
+ return result ._values
1126
1134
else :
1127
1135
try :
1128
1136
result = tools .to_datetime (
You can’t perform that action at this time.
0 commit comments