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 60
60
)
61
61
from pandas .core .dtypes .missing import isna
62
62
63
- from pandas import StringDtype
63
+ from pandas import (
64
+ DatetimeIndex ,
65
+ StringDtype ,
66
+ )
64
67
from pandas .core import algorithms
65
68
from pandas .core .arrays import (
66
69
ArrowExtensionArray ,
@@ -1116,14 +1119,19 @@ def converter(*date_cols, col: Hashable):
1116
1119
date_format .get (col ) if isinstance (date_format , dict ) else date_format
1117
1120
)
1118
1121
1119
- return tools .to_datetime (
1122
+ result = tools .to_datetime (
1120
1123
ensure_object (strs ),
1121
1124
format = date_fmt ,
1122
1125
utc = False ,
1123
1126
dayfirst = dayfirst ,
1124
1127
errors = "ignore" ,
1125
1128
cache = cache_dates ,
1126
- )._values
1129
+ )
1130
+ if isinstance (result , DatetimeIndex ):
1131
+ arr = result .to_numpy ()
1132
+ arr .flags .writeable = True
1133
+ return arr
1134
+ return result ._values
1127
1135
else :
1128
1136
try :
1129
1137
result = tools .to_datetime (
You can’t perform that action at this time.
0 commit comments