Difference between map, applymap and apply methods in Pandas

前端 未结 10 2004
刺人心
刺人心 2020-11-22 03:00

Can you tell me when to use these vectorization methods with basic examples?

I see that map is a Series method whereas the rest are

10条回答
  •  攒了一身酷
    2020-11-22 03:24

    Quick Summary

    • DataFrame.apply operates on entire rows or columns at a time.

    • DataFrame.applymap, Series.apply, and Series.map operate on one element at time.

    Series.apply and Series.map are similar and often interchangeable. Some of their slight differences are discussed in osa's answer below.

提交回复
热议问题