-
-
Notifications
You must be signed in to change notification settings - Fork 17.4k
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
Empty DataFrame constructor disregards dtype kwarg #10106
Comments
Oh, this is on 3.4 In [11]: sys.version_info
Out[11]: sys.version_info(major=3, minor=4, micro=3, releaselevel='final', serial=0) |
this is #4464. It is not implemented to pass a compound dtype. (regardless of the error message) work-around is to do this:
|
Hrm, that's odd. Tests started failing for me only recently. This appeared to be the reason. Looks like I'll have to dig more deeply. Thanks for the rapid response. Closing. |
And thanks for the suggestions. Those look like sane workarounds. |
I also had tests on empty DataFrames start failing with 0.16.1. For me the difference comes down to this differing behavior in the DataFrame constructor, even when both create empty DataFrames:
Note the different dtypes of the columns. |
@jiffyclub these are not the same as the default for a list (even if empty, when no dtype is specified) is to return a float dtype
In the first case (your [2]), however you haven't specified anything at all, so |
Yeah, I think that the new behavior is appropriate. Both @jiffyclub and I were surprised by the change, but that's a small price to pay for progress. |
This is new in 0.16.1
Also other mechanisms to convey dtype information yield uninformative errors
Is there a way to create an empty DataFrame with given dtypes in 0.16.1?
The text was updated successfully, but these errors were encountered: