Skip to content

List of 0-dim np.ndarrays no longer works for DataFrame constructor #4851

@dalejung

Description

@dalejung
data = [np.array(x) for x in range(10)]
pd.DataFrame(data)

4814     else:
   4815         # last ditch effort
-> 4816         data = lmap(tuple, data)
   4817         return _list_to_arrays(data, columns,
   4818                                coerce_float=coerce_float,

TypeError: iteration over a 0-d array

Previously this case would fall through to _prep_ndarray but since common.is_list_like doesn't check that whether the np.ndarray is 0-dim, it incorrectly fails in to_arrays.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions