基于pandas
# Adding up all of the fat columns.
# food_info is a dataframe
# Adding two columns will go through and add each value at each position to the corresponding value in the same position.
total_fat = food_info["FA_Sat_(g)"] + food_info["FA_Mono_(g)"] + food_info["FA_Poly_(g)"]
原文:http://www.cnblogs.com/arsh/p/5128671.html