王亦舟*_*王亦舟 5 python dataframe pandas
我在熊猫中有一个像这样的数据框:
List
2013-12-22 15:25:02 [good morning, good afternoon, good evening]
2009-12-14 14:29:32 [happy new year, happy birthday,]
2013-12-22 15:42:00 [happy, sad, mad, chill]
Run Code Online (Sandbox Code Playgroud)
我怎么得到这样的东西
List Len
2013-12-22 15:25:02 [good morning, good afternoon, good evening] 3
2009-12-14 14:29:32 [happy new year, happy birthday,] 2
2013-12-22 15:42:00 [happy, sad, mad, chill] 4
Run Code Online (Sandbox Code Playgroud)
我试过 df['List'].str.len(),但它返回这个列表中有多少单词的长度。
| 归档时间: |
|
| 查看次数: |
998 次 |
| 最近记录: |