Pandas - Add a New Column

Published: 20 July 2024
on channel: Learn Pandas
19
1

🔥 Free Pandas Course: https://hedaro.gumroad.com/l/tqqfq

In this video, I will show you how to add a new column to your DataFrame.

𝐖𝐞 𝐬𝐭𝐚𝐫𝐭 𝐰𝐢𝐭𝐡:
df = pd.DataFrame({"a":[123,4,56]})

𝐚𝐝𝐝 5 𝐭𝐨 𝐚𝐥𝐥 𝐫𝐨𝐰𝐬
df["b"] = 5

𝐚𝐝𝐝 𝐜𝐨𝐥𝐮𝐦𝐧 "𝐚" 𝐚𝐧𝐝 𝐜𝐨𝐥𝐮𝐦𝐧 "𝐛"
df["c"] = df["a"] + df["b"]


Watch video Pandas - Add a New Column online without registration, duration hours minute second in high quality. This video was added by user Learn Pandas 20 July 2024, don't forget to share it with your friends and acquaintances, it has been viewed on our site 19 once and liked it 1 people.