python pandas 中 apply,applymap 和map的区别

如题所述

apply()
和applymap()是DataFrame数据类型的函数,map()是Series数据类型的函数。

apply()的操作对象DataFrame的一列或者一行数据,
applymap()是element-wise的,作用于每个DataFrame的每个数据。
map()也是element-wise的,对Series中的每个数据调用一次函数。
温馨提示:答案为网友推荐,仅供参考
第1个回答  2017-06-13
apply()
和applymap()是DataFrame数据类型的函数,map()是Series数据类型的函数。

apply()的操作对象DataFrame的一列或者一行数据,
applymap()是element-wise的,作用于每个DataFrame的每个数据。
map()也是element-wise的,对Series中的每个数据调用一次函数。

* apply works on a row / column basis of a DataFrame, applymap
works element-wise on a DataFrame, and map works element-wise on a
Series.