命令如何將熊貓數據框的兩列(行乘法)相乘並將結果存儲在新列中?
df_main['Ranking'] = df_main['Porosity']*['Permeability']
給 -
TypeError: can't multiply sequence by non-int of type 'str'
的attacehd圖片(https://i.stack.imgur.com/0Asu3.png)提供了更多信息。我的代碼段是在i.stack.imgur.com/ehqF5.png)
更多信息:https://i.stack.imgur.com/0Asu3.png
你嘗試'df_main [ '排名'] = df_main [ '孔隙率'] * df_main [ '滲透性']'? – SethMMorton