Skip to content
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

BUG: DataFrame([empty EA Series]) returns NAs with dtype object #56231

Open
3 tasks done
mroeschke opened this issue Nov 28, 2023 · 2 comments
Open
3 tasks done

BUG: DataFrame([empty EA Series]) returns NAs with dtype object #56231

mroeschke opened this issue Nov 28, 2023 · 2 comments
Labels
Bug Constructors Series/DataFrame/Index/pd.array Constructors DataFrame DataFrame data structure NA - MaskedArrays Related to pd.NA and nullable extension arrays

Comments

@mroeschke
Copy link
Member

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

In [23]: df = pd.DataFrame([pd.Series([], dtype="Int64")], columns=[1, 2, 3])

In [24]: df
Out[24]: 
      1     2     3
0  <NA>  <NA>  <NA>

In [25]: df.dtypes
Out[25]: 
1    object
2    object
3    object
dtype: object

Issue Description

Given that the correct NA value was picked up here, I imagine it could be possible to return Int64 types here instead of object

Expected Behavior

Returning Int64 types instead of object

Installed Versions

Replace this line with the output of pd.show_versions()

@mroeschke mroeschke added Bug DataFrame DataFrame data structure Constructors Series/DataFrame/Index/pd.array Constructors NA - MaskedArrays Related to pd.NA and nullable extension arrays labels Nov 28, 2023
@jbrockmendel
Copy link
Member

xref #49593

@phofl
Copy link
Member

phofl commented Jan 7, 2024

I am getting

    1   2   3
0 NaN NaN NaN


1    float64
2    float64
3    float64
dtype: object

on main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Constructors Series/DataFrame/Index/pd.array Constructors DataFrame DataFrame data structure NA - MaskedArrays Related to pd.NA and nullable extension arrays
Projects
None yet
Development

No branches or pull requests

3 participants