-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Remove DataFrame.append from the 10min intro #27518
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
@TomAugspurger I understand what you mean. But don't you think that for a new user |
No I don't think so. I think for that use case we should recommend building
up a list of rows, then wrapping in a Series / DataFrame, then appending.
I'm not sure whether something like that belongs in a 10-minute
introduction though.
…On Mon, Jul 22, 2019 at 9:18 AM Samesh Lakhotia ***@***.***> wrote:
@TomAugspurger <https://github.com/TomAugspurger> I understand what you
mean. But don't you think that for a new user append function might be
useful?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#27518?email_source=notifications&email_token=AAKAOIS54X75GJP47NZBMDTQAW6SZA5CNFSM4IFY4IDKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2QCD5Y#issuecomment-513810935>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAKAOIQEG3G76PFPTDEILDTQAW6SZANCNFSM4IFY4IDA>
.
|
Yeah, you are right. |
Agreed with @TomAugspurger . Occasionally on StackOverflow, you see new users running # INITIALIZE AN EMPTY DATA FRAME
df = pd.DataFrame()
for i in range(5):
# GROW DATA FRAME IN LOOP
df = pd.DataFrame({'int': np.random.randint(1, 10, 500),
'num': np.random.uniform(0, 1, 500)
})
df = df.append(df) As the numpy/pandas guru, @unutbu admonishes: Never call DataFrame.append or pd.concat inside a for-loop. It leads to quadratic copying. |
* DOC:Remove DataFrame.append from the 10min intro Remove the `append` section from 10 min intro doc as complexity of that is very different than `list.append` closes #27518
* DOC:Remove DataFrame.append from the 10min intro Remove the `append` section from 10 min intro doc as complexity of that is very different than `list.append` closes pandas-dev#27518
We show it https://pandas.pydata.org/pandas-docs/stable/getting_started/10min.html#append.
I don't think we should recommend it there, especially without providing context that the complexity of DataFrame.append is very different from list.append.
The text was updated successfully, but these errors were encountered: