sets in str.cat?! · Issue #23009 · pandas-dev/pandas (original) (raw)
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.