Python Forum
[Solved:] How to use pd.append() ?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Solved:] How to use pd.append() ?
#3
This doesn't work either:
# 1) This works fine:   Oh no it doesn't!
 
df1 = pd.DataFrame([[1, 2], [3, 4]], columns=list('AB'))
df2 = pd.DataFrame([[5, 6], [7, 8]], columns=list('AB'))
df1.append(df2)
print(df1)
Output:
A B 0 1 2 1 3 4
In both cases .append() creates a new dataframe instead of modifying the dataframe in place.
ju21878436312 likes this post
Reply


Messages In This Thread
RE: How to use pd.append() ? - by snippsat - Feb-28-2022, 03:50 PM
RE: How to use pd.append() ? - by ju21878436312 - Mar-01-2022, 07:41 AM
RE: How to use pd.append() ? - by deanhystad - Feb-28-2022, 04:27 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [SOLVED] [Beautifulsoup] Find if element exists, and edit/append? Winfried 2 4,530 Sep-03-2022, 10:14 PM
Last Post: Winfried
  Cant Append a word in a line to a list err "str obj has no attribute append Sutsro 2 2,677 Apr-22-2020, 01:01 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020