如何通过计算熊猫数据框中的值巧妙构建新系列?
- 内容介绍
- 文章标签
- 相关推荐
本文共计195个文字,预计阅读时间需要1分钟。
我有这样一个看起来像这样的熊猫数据框:like_count,dislike_count,dog_video,cat_video,bird_video,other_animal_video,animal_category1。
我有一个看起来像这样的熊猫数据框:like_countdislike_countdog_videocat_videobird_我有一个看起来像这样的熊猫数据框:
like_count dislike_count dog_video cat_video bird_video other_animal_video animal_category1000 500 True False False False dog5500 300 False True False False cat2300 100 False False True False bird1100 200 False False False True other
我需要做的是通过计算 animal_category 中的狗,猫,鸟和其他动物的数量来创建新系列。
本文共计195个文字,预计阅读时间需要1分钟。
我有这样一个看起来像这样的熊猫数据框:like_count,dislike_count,dog_video,cat_video,bird_video,other_animal_video,animal_category1。
我有一个看起来像这样的熊猫数据框:like_countdislike_countdog_videocat_videobird_我有一个看起来像这样的熊猫数据框:
like_count dislike_count dog_video cat_video bird_video other_animal_video animal_category1000 500 True False False False dog5500 300 False True False False cat2300 100 False False True False bird1100 200 False False False True other
我需要做的是通过计算 animal_category 中的狗,猫,鸟和其他动物的数量来创建新系列。

