-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: allow axis argument to append / move append code to generic.py (GH8295) #8337
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
Conversation
…GH8295) `append` moved from frame.py to generic.py with docs commented. test cases for DataFrame.append moved from tests_frame.py to tests_generic.py #1 test cases for DataFrame.append moved from tests_frame.py to tests_generic.py #2 test cases for DataFrame.append moved from tests_frame.py to tests_generic.py #3 test cases for Series.append moved from tests_series.py to tests_generic.py `append` in generic.py passes `axis` argument. And added corresponding test case
verify_integrity=verify_integrity) | ||
# def append(self, other, ignore_index=False, verify_integrity=False): | ||
# """ | ||
# Append columns of other to end of this frame's columns and index, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
simply delete this code (rather than comment it out).
@htkm the answer to your question is yes, |
I made some changes to follow your advice. And for generic df = pd.DataFrame(np.random.randn(2,2), columns=list('AB'))
sr = pd.Series(range(2), index=[0,10], name='SR')
pd.concat((df, sr), axis=1)
A B SR
0 0.376365 -0.830094 0
1 0.765837 1.001402 NaN
10 NaN NaN 1
df.append(sr.to_frame(), axis=1)
A B SR
0 0.376365 -0.830094 0
1 0.765837 1.001402 NaN
10 NaN NaN 1
df.append(sr, axis=1)
A B 0 10 A B 0 10
0 0.376365 -0.830094 NaN NaN NaN NaN NaN NaN
1 0.765837 1.001402 NaN NaN NaN NaN NaN NaN
SR NaN NaN NaN NaN NaN NaN 0 1 I think |
@htkm I think you are right, the last |
can you rebase this on master and see where it is? |
closing pls reopen if/when updated |
closes #8295
append
method inframe.py
intogeneric.py
test_frame.py
intotest_generic.py
test_series.py
intotest_generic.py
axis=1
intest_generic.py
append
ingeneric.py
NotImeplementedError
forPanel
append
One more thing, could
Series.append
useaxis=1
as well ?It would be awesome if I could get your guidance to close this issue under the project's convention. Thank you !