pandas
- 求和
column_list = [‘Fiber_TD_(g)‘, ‘Sugar_Tot_(g)‘] # Let‘s sum up the total amount of fiber and sugar across all the foods. total = food_info[column_list].sum(axis=0) # result has two values, one is the taotal fiber of all foods, the other is the total sugar of all foods
时间: 2024-10-11 07:12:53