Answer: Pandas: shorten notation for simple operations on multiple columns

kartikeyas00

Kartikeya Sharma

Posted on October 8, 2019

Answer: Pandas: shorten notation for simple operations on multiple columns

You can easily do it like this

df[['A','B','C']] = df[['A','B','C']]/2

Sometime pandas just surprise you!

馃挅 馃挭 馃檯 馃毄
kartikeyas00
Kartikeya Sharma

Posted on October 8, 2019

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related