Skip to content

BUG: convert_objects(convert_numeric=True) fails with all strings #9589

Closed
@bashtage

Description

@bashtage
s=pd.Series(['a','a','a'])

s.convert_objects(convert_numeric=True)
Out[78]: 
0    a
1    a
2    a
dtype: object

s[0]=1.0

s
Out[80]: 
0    1
1    a
2    a
dtype: object

s.convert_objects(convert_numeric=True)
Out[81]: 
0     1
1   NaN
2   NaN
dtype: float64

Having a single number changes behavior. Makes convert_objects unreliable when the data type must be numeric.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions