You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
@h-vetinari There's definitely ways that this can misbehave, but the docstring for is_listlike shows using sets as an example, so it looks like it was intended?
@pambot
There was time pressure for #20347 before v0.23.0rc and a few things did not get fully discussed. Had I known that is_listlike(<set>) = True, I would have excluded it specifically.
In fact, I'm struggling to think of a use-case in pandas where the order is irrelevant - it's a different (and larger) discussion whether that aspect of is_listlike should maybe be changed, but it should definitely be changed for .str.cat
In #20347, I was asked to allow list-like inputs for the
.str.cat
methods for Series. However, I didn't know thatis_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:
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.
The text was updated successfully, but these errors were encountered: