我有一个包含5列的数据框,我只想添加第二和第三列,但是第三列中的每个点必须乘以3 ,
,所以我需要添加一个新列
"Total score" which is df['Second'] + 3* df['Third']
我尝试过求和,但是我不知道该如何指示我要称重并仅选择两列
答案 0 :(得分:1)
确保您的列顺序正确,然后我们可以使用async function getPlayers() {
const response = await fetch('https://football-players-b31f2.firebaseio.com/players.json?print=pretty');
return response.json();
}
(async () => {
const players = await getPlayers();
console.log(players)
})();
dot
为了安全起见
df['Total Score'] = df.dot([0,1,3,0,0])