[英]How to change the value in another column of a certain category in a pandas dataframe?
I'm currently working on a dataframe and in a certain column I have different categories of classes (organism taxonomy).我目前正在研究一个数据框,并且在某个列中我有不同类别的类(生物分类法)。 In this class column there are 105 unique classes in the +/- 3000 rows.
在这个类列中,+/- 3000 行中有 105 个独特的类。 You can view each row as a species.
您可以将每一行视为一个物种。 Multiple species can belong to 1 class.
多个物种可以属于 1 个类。
For the class "Unknown" in this class column, I would like to change the value of the column "Superkingdom_name" in each of the rows which have "Unknown" in the class column.对于此类列中的“Unknown”类,我想更改类列中具有“Unknown”的每一行中“Superkingdom_name”列的值。 How is this done?
这是怎么做的?
I'm currently clueless of how to do this.我目前不知道如何做到这一点。
So I expect to change the value of "Superkingdom_name" for every row that has value "unknown" in the class column.因此,我希望为类列中具有“未知”值的每一行更改“Superkingdom_name”的值。
Thanks!谢谢!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.