Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dalejung opened this issue Sep 16, 2013 · 1 comment · Fixed by #4852
Closed

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

dalejung opened this issue Sep 16, 2013 · 1 comment · Fixed by #4852

Comments

@dalejung
Copy link
Contributor

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
Copy link
Contributor

jreback commented Sep 16, 2013

thanks...apparantly not testing that case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants