Skip to content

BUG: Inconsistency in converting Series to Dataframe when columns specified #10006

Closed
@artemyk

Description

@artemyk

The dtypes don't match:

In [16]: pd.DataFrame(pd.Series([], dtype="int64"), columns=["D"]).dtypes
Out[16]: 
D    object
dtype: object

In [17]: pd.DataFrame(pd.Series([], dtype="int64")).dtypes
Out[17]: 
0    int64
dtype: object

This came up in #9983 .

When this is fixed, the check_dtype flag should also be removed in TestDataFrame.test_mode in pandas/tests/test_frame.py .

Metadata

Metadata

Assignees

No one assigned

    Labels

    Compatpandas objects compatability with Numpy or Python functionsDtype ConversionsUnexpected or buggy dtype conversions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions