-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: pd.concat with all Series on axis=1 ignores the names
argument.
#23490
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
Comments
on axis=1 ignores the
names` argument.names
argument.
@ArtinSarraf : Good catch! Feel free to submit your patch as a PR! |
4 tasks
gfyoung
pushed a commit
that referenced
this issue
Nov 6, 2018
JustinZhengBC
pushed a commit
to JustinZhengBC/pandas
that referenced
this issue
Nov 14, 2018
tm9k1
pushed a commit
to tm9k1/pandas
that referenced
this issue
Nov 19, 2018
Pingviinituutti
pushed a commit
to Pingviinituutti/pandas
that referenced
this issue
Feb 28, 2019
Pingviinituutti
pushed a commit
to Pingviinituutti/pandas
that referenced
this issue
Feb 28, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Code Sample, a copy-pastable example if possible
Problem description
This is a problem because the API allows a user to provide a names argument with these input types and rather than throw an error or take the argument into consideration it is ignored. As far as I can tell, there is no reason for the names argument to be ignored, considering the keys are applied correctly, so I believe this was just an oversight in the
core.reshape.concat._Concatenator._get_concat_axis
method.Proposed Solution
On line 503 of pandas/core/reshape/concat.py the following line:
return ensure_index(self.keys)
Should be replaced with something along these lines:
This solution solves provides the desired output for both examples above and does not break any of the test_concat.py tests.
Output of
pd.show_versions()
pandas: 0.24.0.dev0
The text was updated successfully, but these errors were encountered: