-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
str.cat does not align on index? #18657
Comments
Yes, this should probably align when I'd favor a keyword like |
Do we have any other string operations that take a Series / DataFrame and should be handled similarly? |
Cool! I think your proposal for dealing with the API-breaking sounds good, except maybe calling it Looking at https://pandas-docs.github.io/pandas-docs-travis/text.html#method-summary, |
align=None will let us detect whether or not the user explicitly wanted
alignment. So it's
if align is None:
warnings.warn("A future version of pandas will perform alignment when
others is a series. To disable alignment (the previous behavior) and
silence this warning, pass 'align=False'. To enable alignment (the future
behavior) and silence this warning, pass 'align=True'
…On Wed, Dec 6, 2017 at 2:35 PM, h-vetinari ***@***.***> wrote:
Cool! I think your proposal for dealing with the API-breaking sounds good,
except maybe calling it align = False by default first, and changing to
True at some point in the future (not unlike the expand-keyword that
.str.extract gained in 0.18)
Looking at https://pandas-docs.github.io/pandas-docs-travis/text.html#
method-summary,
it seems that .str.cat is the only method that deals with two different
Series. Maybe that's why the alignment for it fell through the cracks?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#18657 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABQHIqzEV4m0rYAwm7zFDhZQXZbrrteIks5s9vqjgaJpZM4Q3erA>
.
|
@TomAugspurger @jreback |
The implicit index-matching of
pandas
for operations between differentDataFrame
/Series
is great and most of the times, it just works. It does so consistently enough, that the expectation (for me) is that different Series will be aligned before an operation is performed.For some reason,
str.cat
does not seem to do so.The text was updated successfully, but these errors were encountered: