Uploaded October 2020 | Updated November 2026, 2 hours ago
↓ Code Available Below! ↓
This video shows how to concatenate data frames using the pandas library in Python. Data frame concatenation, also known as pasting or binding, just means joining together two data frames that have either the same columns or the same rows. In other words, using concatenate lets you add more rows or columns to an existing data frame. Concatenation should not be confused with join (merge) operations that involve combining the records of two data tables based on one or more shared key columns.
If you find this video useful, like, share and subscribe to support the channel!
► Subscribe: youtube.com/c/DataDaft?sub_confirmation=1
Code used in this Python Code Clip:
import pandas as pd
data = pd.DataFrame({"character": ["Goku","Vegeta", "Nappa","Gohan","Piccolo"],
"power level": [12000, 16000, 4000, 1500, 3000]})
data
new_rows = pd.DataFrame({"character": ["Tien","Yamcha", "Krillin"],
"power level": [2000, 1600, 2000]})
new_rows
# Concatenate Data Frames by Rows
data2 = pd.concat([data, new_rows], # List of data Frames to concatenate
axis=0, # Axis = 0 to concat by row
ignore_index=True)
data2
new_cols = pd.DataFrame({"uniform color": ["orange", "blue", "black", "orange",
"purple", "green", "orange", "orange"],
"species":["saiyan","saiyan","saiyan","half saiyan",
"namak","human","human","human"]})
new_cols
# Concatenate Data Frames by Columns
pd.concat([data2, new_cols], # List of data Frames to concatenate
axis=1) # Axis = 1 to concat by column
* Note: YouTube does not allow greater than or less than symbols in the text description, so the code above will not be exactly the same as the code shown in the video! I will use Unicode large < and > symbols in place of the standard sized ones. .
⭐ Kite is a free AI-powered coding assistant that integrates with popular editors and IDEs to give you smart code completions and docs while you’re typing. It is a cool application of machine learning that can also help you code faster! Check it out here: kite.com/get-kite/?utm_medium=referral&utm_source=youtube&utm_campaign=datadaft&utm_content=description-only
↓ Code Available Below! ↓
This video shows how to concatenate data frames using the pandas library in Python. Data frame concatenation, also known as pasting or binding, just means joining together two data frames that have either the same columns or the same rows. In other words, using concatenate lets you add more rows or columns to an existing data frame. Concatenation should not be confused with join (merge) operations that involve combining the records of two data tables based on one or more shared key columns.
If you find this video useful, like, share and subscribe to support the channel!
► Subscribe: youtube.com/c/DataDaft?sub_confirmation=1
Code used in this Python Code Clip:
import pandas as pd
data = pd.DataFrame({"character": ["Goku","Vegeta", "Nappa","Gohan","Piccolo"],
"power level": [12000, 16000, 4000, 1500, 3000]})
data
new_rows = pd.DataFrame({"character": ["Tien","Yamcha", "Krillin"],
"power level": [2000, 1600, 2000]})
new_rows
# Concatenate Data Frames by Rows
data2 = pd.concat([data, new_rows], # List of data Frames to concatenate
axis=0, # Axis = 0 to concat by row
ignore_index=True)
data2
new_cols = pd.DataFrame({"uniform color": ["orange", "blue", "black", "orange",
"purple", "green", "orange", "orange"],
"species":["saiyan","saiyan","saiyan","half saiyan",
"namak","human","human","human"]})
new_cols
# Concatenate Data Frames by Columns
pd.concat([data2, new_cols], # List of data Frames to concatenate
axis=1) # Axis = 1 to concat by column
* Note: YouTube does not allow greater than or less than symbols in the text description, so the code above will not be exactly the same as the code shown in the video! I will use Unicode large < and > symbols in place of the standard sized ones. .
⭐ Kite is a free AI-powered coding assistant that integrates with popular editors and IDEs to give you smart code completions and docs while you’re typing. It is a cool application of machine learning that can also help you code faster! Check it out here: kite.com/get-kite/?utm_medium=referral&utm_source=youtube&utm_campaign=datadaft&utm_content=description-only






![How To Use map() in Python
map() is a Python built in that lets you apply or map a function to each element in a list or iterable object. map() is one of the most useful Python built in functions for data analytics, since you will often be working with large sequence data types that need to be transformed in various ways.
Code used in the video:
# Map lets you apply a function to each element of a list
power_level_list = [1000, 4000, 16000, 150, 9001, 1500]
def greater_than_9000(x):
if x > 9000:
return True
return False
mapped = map(greater_than_9000, power_level_list)
print(mapped)
# Print each mapping
for m in mapped:
print(m)
# Extract mapping into new list
mapped_list = [*map(greater_than_9000, power_level_list)]
mapped_list
# Use map with a lambda function
[*map(lambda x: x > 9000, power_level_list)]
* Note: YouTube does not allow greater than or less than symbols in the text description, so the code above will not be exactly the same as the code shown in the video! I will use Unicode large < and > symbols in place of the standard sized ones. .
Videos on Pandas map() operations:
How To Use apply() In Pandas (Python)
https://www.youtube.com/watch?v=smPLY_5gVv4&ab_channel=DataDaft
How To Use applymap() In Pandas (Python)
https://www.youtube.com/watch?v=azF6O_mzaCI&ab_channel=DataDaft How To Use map() in Python](https://i.ytimg.com/vi/E4fSP3cOHCE/mqdefault.jpg)



