1,使用pandas内置的.str.len()函数

df["contentLen”]=df["column"].str.len()

2.使用pandas内置函数map+lamda

df["contentLen"]=df["column"].map(lambda x:len(x))

 

 posted on 2024-05-05 11:29  会飞的金鱼  阅读(35)  评论(0)    收藏  举报