BUG (string): contruction of Series / Index fails from dict keys when "str" dtype is specified explicitly #60343
Labels
Bug
Constructors
Series/DataFrame/Index/pd.array Constructors
Strings
String extension data type and string data
Milestone
When not specifying a dtype (inferring the type), construction of
Index
orSeries
from dict keys goes fine:But if you explicitly specify the dtype, then it fails:
The reason is that at that point we pass the data directly to the dtype's array
_from_sequence
instead of first pre-processing the data into a numpy array, and_from_sequence
callingensure_string_array
directly doesn't seem to be able to handle dict keys (although we do callnp.asarray(..)
insideensure_string_array
, so not entirely sure what is going wrong)The text was updated successfully, but these errors were encountered: