Chapter 15. Combining Pandas Objects
A wide variety of options are available to combine two or more DataFrames or Series together. The append
method is the least flexible and only allows for new rows to be appended to a DataFrame. The concat
method is very versatile and can combine any number of DataFrames or Series on either axis. The join
method provides fast lookups by aligning a column of one DataFrame to the index of others. The merge
method provides SQL-like capabilities to join two DataFrames together.Â
In this chapter, we will cover the following topics:
- Appending new rows to DataFrames
- Concatenating multiple DataFrames together
- Comparing President Trump's and Obama's approval ratings
- Understanding the differences betweenÂ
concat
,Âjoin
, andÂmerge
- Connecting to SQL databases