命令
df_main['Ranking'] = df_main['Porosity']*['Permeability']
给出-
TypeError: can't multiply sequence by non-int of type 'str'
附件hd图片(https://i.stack.imgur.com/0Asu3.png)有更多信息。我的代码片段位于i.stack.imgur.com/ehqF5.png)
更多信息:https://i.stack.imgur.com/0Asu3.png
Tags:
首先,需要将两列的列类型转换为浮点(否则不能相乘)。你可以这样做:
然后可以通过乘法定义新列:
相关问题 更多 >
编程相关推荐