Skip to content

ENH: allow complex type inference in astype/convert_objects #4895

Closed
@jreback

Description

@jreback

astype/convert_objects should be able to do this type of coercion from string complex looking

In [45]: Series(['1.0+5j','1.5-3j']).apply(lambda x: np.complex(x))
Out[45]: 
0      (1+5j)
1    (1.5-3j)
dtype: complex128

http://stackoverflow.com/questions/18919699/python-pandas-complex-number/18919965#18919965

Metadata

Metadata

Assignees

Labels

ComplexComplex NumbersDtype ConversionsUnexpected or buggy dtype conversionsEnhancementNeeds TestsUnit test(s) needed to prevent regressions

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions