Skip to content

ERR: invalid input to .str.replace does not raise #13438

Closed
@jreback

Description

@jreback

This should raise; None is not an allowed option for the replacement.

In [2]: s = pd.Series(['a', 'b', None])

In [3]: s
Out[3]: 
0       a
1       b
2    None
dtype: object

In [4]: s.str.replace('a', None)
Out[4]: 
0   NaN
1   NaN
2   NaN
dtype: float64

cc @Kwsmith

Metadata

Metadata

Assignees

No one assigned

    Labels

    Error ReportingIncorrect or improved errors from pandasStringsString extension data type and string data

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions