We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c967d6b commit fe1a1d1Copy full SHA for fe1a1d1
pandas/core/construction.py
@@ -612,10 +612,8 @@ def sanitize_array(
612
if dtype is None:
613
subarr = data
614
if data.dtype == object and infer_object:
615
- # GH#61026
616
- if data.ndim != 1:
617
- subarr = subarr.ravel()
618
- subarr = maybe_infer_to_datetimelike(subarr)
+ fltarr = data.ravel() # GH#61026
+ subarr = maybe_infer_to_datetimelike(fltarr).reshape(data.shape)
619
elif data.dtype.kind == "U" and using_string_dtype():
620
from pandas.core.arrays.string_ import StringDtype
621
0 commit comments