pandas-dev / pandas

Flexible and powerful data analysis / manipulation library for Python, providing labeled data structures similar to R data.frame objects, statistical functions, and much more
https://pandas.pydata.org
BSD 3-Clause "New" or "Revised" License
43.62k stars 17.91k forks source link

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

Closed dalejung closed 11 years ago

dalejung commented 11 years ago
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.

jreback commented 11 years ago

thanks...apparantly not testing that case