Skip to content

sets in str.cat?! #23009

Closed
Closed
@h-vetinari

Description

@h-vetinari

In #20347, I was asked to allow list-like inputs for the .str.cat methods for Series. However, I didn't know that is_listlike({'a', 'b', 'c'}) is True (for sets) until I stumbled over it in #22486.

These objects should imo clearly be disallowed, lest users shoot themselves in the foot massively:

>>> s = pd.Series(['a', 'b', 'c'])
>>> s.str.cat({'a', 'b', 'c'})
0    ac
1    bb
2    ca
dtype: object

I'm not even sure this should go through a deprecation cycle - IMO it's just a plain ol' bug that should be fixed ASAP.

Metadata

Metadata

Assignees

No one assigned

    Labels

    API DesignStringsString extension data type and string data

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions