100天精通Python(数据分析篇)——第63天:Pandas使用自定义函数案例(pipe、apply、map、applymap、agg)

在这里插入图片描述

一、Pandas自定义函数

自定义函数是指:有时候需要对 pandas 里的值进行一些特殊操作,但是没有内置函数,或者把其他库中的函数应用到 Pandas 对象中,这时候可以自己写的一个函数

1. pipe()

通过给 pipe() 函数传递一个自定义函数和适当数量的参数值,从而操作 DataFrme 中的所有元素

语法格式

DataFrame.pipe

猜你喜欢

转载自blog.csdn.net/yuan2019035055/article/details/127717051