Skip to content

Complex64 implicitly converted to Complex128 #10952

Closed
@sklam

Description

@sklam

NumPy array of complex64 is implicitly converted to complex128 when used as data for DataFrame:

>>> a=np.random.randn(10).astype(np.complex64)
>>> a.dtype
dtype('complex64')
>>> pd.DataFrame({'a': a}).a.dtype
dtype('complex128')
>>> 

The problem does not affect Series:

In [7]: Series(a).dtype
Out[7]: dtype('complex64')

Metadata

Metadata

Assignees

No one assigned

    Labels

    ComplexComplex NumbersDtype ConversionsUnexpected or buggy dtype conversions

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions