Skip to content
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

BUG: empty Series concat has no effect #11082

Closed
sinhrks opened this issue Sep 12, 2015 · 1 comment
Closed

BUG: empty Series concat has no effect #11082

sinhrks opened this issue Sep 12, 2015 · 1 comment
Labels
Bug Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Milestone

Comments

@sinhrks
Copy link
Member

sinhrks commented Sep 12, 2015

import numpy as np
import pandas as pd

s1 = pd.Series([1, 2, 3], name='x')
s2 = pd.Series(name='y')

# NG, no columns is added
pd.concat([s1, s2], axis=1)
#    x
#0  1
#1  2
#2  3

# If padded by value, OK
pd.concat([s1, pd.Series([np.nan]*3, name='z')], axis=1)
#    x   z
#0  1 NaN
#1  2 NaN
#2  3 NaN

# If converted to frame, OK.
pd.concat([s1.to_frame(), s2.to_frame()], axis=1)
#    x   y
#0  1 NaN
#1  2 NaN
#2  3 NaN
@sinhrks sinhrks added Bug Reshaping Concat, Merge/Join, Stack/Unstack, Explode labels Sep 12, 2015
@jreback
Copy link
Contributor

jreback commented Sep 12, 2015

xref #10698 prob getting excluded here (pr is #10723)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants