我想在单元格中使用以下IF语句,而不是每个Google表格单元格。现在我正在复制并将相同的代码粘贴到每个单元格。我如何申请这个我的'我'列,以便该列中的任何单元格具有此逻辑?我确信有更简单的方法可以做到这一点,但我对电子表格并不满意。
name = ['bob','sam','joe']
age = [25,32,50]
wage = [50000, 75000, 32000]
people = {}
for i in range(0,3):
people[i] = {'name':name[i], 'age':age[i],'wage':wage[i]}
# you should now have a data frame where each row is a person
# you have one string column (name), and two numerics (age and wage)
df = pd.DataFrame(people).transpose()
df['wage_per_year'] = df['wage']/df['age']
print df