数据分析---《Python for Data Analysis》学习笔记【04】
《Python for Data Analysis》一書由Wes?Mckinney所著,中文譯名是《利用Python進行數據分析》。這里記錄一下學習過程,其中有些方法和書中不同,是按自己比較熟悉的方式實現的。
?
第四個實例:USDA Food Database
?
簡介:美國農業部(USDA)制作了一份有關食物營養信息的數據
?
數據下載地址:?https://github.com/wesm/pydata-book/tree/2nd-edition/datasets/usda_food
?
準備工作:導入pandas和matplotlib,因為需要讀取JSON格式的文件,因此這里還需要導入json模塊
import pandas as pd import json import matplotlib.pyplot as plt fig,ax=plt.subplots()?
使用json模塊打開database.json文件:
with open (r"C:\Users\ccav\Downloads\database.json") as f:data=json.load(f)?
文件第一項就含有這么多內容:
[{'id': 1008, 'description': 'Cheese, caraway', 'tags': [], 'manufacturer': '', 'group': 'Dairy and Egg Products', 'portions': [{'amount': 1, 'unit': 'oz', 'grams': 28.35}], 'nutrients': [{'value': 25.18, 'units': 'g', 'description': 'Protein', 'group': 'Composition'}, {'value': 29.2, 'units': 'g', 'description': 'Total lipid (fat)', 'group': 'Composition'}, {'value': 3.06, 'units': 'g', 'description': 'Carbohydrate, by difference', 'group': 'Composition'}, {'value': 3.28, 'units': 'g', 'description': 'Ash', 'group': 'Other'}, {'value': 376.0, 'units': 'kcal', 'description': 'Energy', 'group': 'Energy'}, {'value': 39.28, 'units': 'g', 'description': 'Water', 'group': 'Composition'}, {'value': 1573.0, 'units': 'kJ', 'description': 'Energy', 'group': 'Energy'}, {'value': 0.0, 'units': 'g', 'description': 'Fiber, total dietary', 'group': 'Composition'}, {'value': 673.0, 'units': 'mg', 'description': 'Calcium, Ca', 'group': 'Elements'}, {'value': 0.64, 'units': 'mg', 'description': 'Iron, Fe', 'group': 'Elements'}, {'value': 22.0, 'units': 'mg', 'description': 'Magnesium, Mg', 'group': 'Elements'}, {'value': 490.0, 'units': 'mg', 'description': 'Phosphorus, P', 'group': 'Elements'}, {'value': 93.0, 'units': 'mg', 'description': 'Potassium, K', 'group': 'Elements'}, {'value': 690.0, 'units': 'mg', 'description': 'Sodium, Na', 'group': 'Elements'}, {'value': 2.94, 'units': 'mg', 'description': 'Zinc, Zn', 'group': 'Elements'}, {'value': 0.024, 'units': 'mg', 'description': 'Copper, Cu', 'group': 'Elements'}, {'value': 0.021, 'units': 'mg', 'description': 'Manganese, Mn', 'group': 'Elements'}, {'value': 14.5, 'units': 'mcg', 'description': 'Selenium, Se', 'group': 'Elements'}, {'value': 1054.0, 'units': 'IU', 'description': 'Vitamin A, IU', 'group': 'Vitamins'}, {'value': 262.0, 'units': 'mcg', 'description': 'Retinol', 'group': 'Vitamins'}, {'value': 271.0, 'units': 'mcg_RAE', 'description': 'Vitamin A, RAE', 'group': 'Vitamins'}, {'value': 0.0, 'units': 'mg', 'description': 'Vitamin C, total ascorbic acid', 'group': 'Vitamins'}, {'value': 0.031, 'units': 'mg', 'description': 'Thiamin', 'group': 'Vitamins'}, {'value': 0.45, 'units': 'mg', 'description': 'Riboflavin', 'group': 'Vitamins'}, {'value': 0.18, 'units': 'mg', 'description': 'Niacin', 'group': 'Vitamins'}, {'value': 0.19, 'units': 'mg', 'description': 'Pantothenic acid', 'group': 'Vitamins'}, {'value': 0.074, 'units': 'mg', 'description': 'Vitamin B-6', 'group': 'Vitamins'}, {'value': 18.0, 'units': 'mcg', 'description': 'Folate, total', 'group': 'Vitamins'}, {'value': 0.27, 'units': 'mcg', 'description': 'Vitamin B-12', 'group': 'Vitamins'}, {'value': 0.0, 'units': 'mcg', 'description': 'Folic acid', 'group': 'Vitamins'}, {'value': 18.0, 'units': 'mcg', 'description': 'Folate, food', 'group': 'Vitamins'}, {'value': 18.0, 'units': 'mcg_DFE', 'description': 'Folate, DFE', 'group': 'Vitamins'}, {'value': 93.0, 'units': 'mg', 'description': 'Cholesterol', 'group': 'Other'}, {'value': 18.584, 'units': 'g', 'description': 'Fatty acids, total saturated', 'group': 'Other'}, {'value': 8.275, 'units': 'g', 'description': 'Fatty acids, total monounsaturated', 'group': 'Other'}, {'value': 0.83, 'units': 'g', 'description': 'Fatty acids, total polyunsaturated', 'group': 'Other'}, {'value': 0.324, 'units': 'g', 'description': 'Tryptophan', 'group': 'Amino Acids'}, {'value': 0.896, 'units': 'g', 'description': 'Threonine', 'group': 'Amino Acids'}, {'value': 1.563, 'units': 'g', 'description': 'Isoleucine', 'group': 'Amino Acids'}, {'value': 2.412, 'units': 'g', 'description': 'Leucine', 'group': 'Amino Acids'}, {'value': 2.095, 'units': 'g', 'description': 'Lysine', 'group': 'Amino Acids'}, {'value': 0.659, 'units': 'g', 'description': 'Methionine', 'group': 'Amino Acids'}, {'value': 0.126, 'units': 'g', 'description': 'Cystine', 'group': 'Amino Acids'}, {'value': 1.326, 'units': 'g', 'description': 'Phenylalanine', 'group': 'Amino Acids'}, {'value': 1.216, 'units': 'g', 'description': 'Tyrosine', 'group': 'Amino Acids'}, {'value': 1.682, 'units': 'g', 'description': 'Valine', 'group': 'Amino Acids'}, {'value': 0.952, 'units': 'g', 'description': 'Arginine', 'group': 'Amino Acids'}, {'value': 0.884, 'units': 'g', 'description': 'Histidine', 'group': 'Amino Acids'}, {'value': 0.711, 'units': 'g', 'description': 'Alanine', 'group': 'Amino Acids'}, {'value': 1.618, 'units': 'g', 'description': 'Aspartic acid', 'group': 'Amino Acids'}, {'value': 6.16, 'units': 'g', 'description': 'Glutamic acid', 'group': 'Amino Acids'}, {'value': 0.439, 'units': 'g', 'description': 'Glycine', 'group': 'Amino Acids'}, {'value': 2.838, 'units': 'g', 'description': 'Proline', 'group': 'Amino Acids'}, {'value': 1.472, 'units': 'g', 'description': 'Serine', 'group': 'Amino Acids'}, {'value': 25.18, 'units': 'g', 'description': 'Protein', 'group': 'Composition'}, {'value': 29.2, 'units': 'g', 'description': 'Total lipid (fat)', 'group': 'Composition'}, {'value': 3.06, 'units': 'g', 'description': 'Carbohydrate, by difference', 'group': 'Composition'}, {'value': 3.28, 'units': 'g', 'description': 'Ash', 'group': 'Other'}, {'value': 376.0, 'units': 'kcal', 'description': 'Energy', 'group': 'Energy'}, {'value': 39.28, 'units': 'g', 'description': 'Water', 'group': 'Composition'}, {'value': 1573.0, 'units': 'kJ', 'description': 'Energy', 'group': 'Energy'}, {'value': 0.0, 'units': 'g', 'description': 'Fiber, total dietary', 'group': 'Composition'}, {'value': 673.0, 'units': 'mg', 'description': 'Calcium, Ca', 'group': 'Elements'}, {'value': 0.64, 'units': 'mg', 'description': 'Iron, Fe', 'group': 'Elements'}, {'value': 22.0, 'units': 'mg', 'description': 'Magnesium, Mg', 'group': 'Elements'}, {'value': 490.0, 'units': 'mg', 'description': 'Phosphorus, P', 'group': 'Elements'}, {'value': 93.0, 'units': 'mg', 'description': 'Potassium, K', 'group': 'Elements'}, {'value': 690.0, 'units': 'mg', 'description': 'Sodium, Na', 'group': 'Elements'}, {'value': 2.94, 'units': 'mg', 'description': 'Zinc, Zn', 'group': 'Elements'}, {'value': 0.024, 'units': 'mg', 'description': 'Copper, Cu', 'group': 'Elements'}, {'value': 0.021, 'units': 'mg', 'description': 'Manganese, Mn', 'group': 'Elements'}, {'value': 14.5, 'units': 'mcg', 'description': 'Selenium, Se', 'group': 'Elements'}, {'value': 1054.0, 'units': 'IU', 'description': 'Vitamin A, IU', 'group': 'Vitamins'}, {'value': 262.0, 'units': 'mcg', 'description': 'Retinol', 'group': 'Vitamins'}, {'value': 271.0, 'units': 'mcg_RAE', 'description': 'Vitamin A, RAE', 'group': 'Vitamins'}, {'value': 0.0, 'units': 'mg', 'description': 'Vitamin C, total ascorbic acid', 'group': 'Vitamins'}, {'value': 0.031, 'units': 'mg', 'description': 'Thiamin', 'group': 'Vitamins'}, {'value': 0.45, 'units': 'mg', 'description': 'Riboflavin', 'group': 'Vitamins'}, {'value': 0.18, 'units': 'mg', 'description': 'Niacin', 'group': 'Vitamins'}, {'value': 0.19, 'units': 'mg', 'description': 'Pantothenic acid', 'group': 'Vitamins'}, {'value': 0.074, 'units': 'mg', 'description': 'Vitamin B-6', 'group': 'Vitamins'}, {'value': 18.0, 'units': 'mcg', 'description': 'Folate, total', 'group': 'Vitamins'}, {'value': 0.27, 'units': 'mcg', 'description': 'Vitamin B-12', 'group': 'Vitamins'}, {'value': 0.0, 'units': 'mcg', 'description': 'Folic acid', 'group': 'Vitamins'}, {'value': 18.0, 'units': 'mcg', 'description': 'Folate, food', 'group': 'Vitamins'}, {'value': 18.0, 'units': 'mcg_DFE', 'description': 'Folate, DFE', 'group': 'Vitamins'}, {'value': 0.324, 'units': 'g', 'description': 'Tryptophan', 'group': 'Amino Acids'}, {'value': 0.896, 'units': 'g', 'description': 'Threonine', 'group': 'Amino Acids'}, {'value': 1.563, 'units': 'g', 'description': 'Isoleucine', 'group': 'Amino Acids'}, {'value': 2.412, 'units': 'g', 'description': 'Leucine', 'group': 'Amino Acids'}, {'value': 2.095, 'units': 'g', 'description': 'Lysine', 'group': 'Amino Acids'}, {'value': 0.659, 'units': 'g', 'description': 'Methionine', 'group': 'Amino Acids'}, {'value': 0.126, 'units': 'g', 'description': 'Cystine', 'group': 'Amino Acids'}, {'value': 1.326, 'units': 'g', 'description': 'Phenylalanine', 'group': 'Amino Acids'}, {'value': 1.216, 'units': 'g', 'description': 'Tyrosine', 'group': 'Amino Acids'}, {'value': 1.682, 'units': 'g', 'description': 'Valine', 'group': 'Amino Acids'}, {'value': 0.952, 'units': 'g', 'description': 'Arginine', 'group': 'Amino Acids'}, {'value': 0.884, 'units': 'g', 'description': 'Histidine', 'group': 'Amino Acids'}, {'value': 0.711, 'units': 'g', 'description': 'Alanine', 'group': 'Amino Acids'}, {'value': 1.618, 'units': 'g', 'description': 'Aspartic acid', 'group': 'Amino Acids'}, {'value': 6.16, 'units': 'g', 'description': 'Glutamic acid', 'group': 'Amino Acids'}, {'value': 0.439, 'units': 'g', 'description': 'Glycine', 'group': 'Amino Acids'}, {'value': 2.838, 'units': 'g', 'description': 'Proline', 'group': 'Amino Acids'}, {'value': 1.472, 'units': 'g', 'description': 'Serine', 'group': 'Amino Acids'}, {'value': 93.0, 'units': 'mg', 'description': 'Cholesterol', 'group': 'Other'}, {'value': 18.584, 'units': 'g', 'description': 'Fatty acids, total saturated', 'group': 'Other'}, {'value': 8.275, 'units': 'g', 'description': 'Fatty acids, total monounsaturated', 'group': 'Other'}, {'value': 0.83, 'units': 'g', 'description': 'Fatty acids, total polyunsaturated', 'group': 'Other'}, {'value': 25.18, 'units': 'g', 'description': 'Protein', 'group': 'Composition'}, {'value': 29.2, 'units': 'g', 'description': 'Total lipid (fat)', 'group': 'Composition'}, {'value': 3.06, 'units': 'g', 'description': 'Carbohydrate, by difference', 'group': 'Composition'}, {'value': 3.28, 'units': 'g', 'description': 'Ash', 'group': 'Other'}, {'value': 376.0, 'units': 'kcal', 'description': 'Energy', 'group': 'Energy'}, {'value': 39.28, 'units': 'g', 'description': 'Water', 'group': 'Composition'}, {'value': 1573.0, 'units': 'kJ', 'description': 'Energy', 'group': 'Energy'}, {'value': 0.0, 'units': 'g', 'description': 'Fiber, total dietary', 'group': 'Composition'}, {'value': 673.0, 'units': 'mg', 'description': 'Calcium, Ca', 'group': 'Elements'}, {'value': 0.64, 'units': 'mg', 'description': 'Iron, Fe', 'group': 'Elements'}, {'value': 22.0, 'units': 'mg', 'description': 'Magnesium, Mg', 'group': 'Elements'}, {'value': 490.0, 'units': 'mg', 'description': 'Phosphorus, P', 'group': 'Elements'}, {'value': 93.0, 'units': 'mg', 'description': 'Potassium, K', 'group': 'Elements'}, {'value': 690.0, 'units': 'mg', 'description': 'Sodium, Na', 'group': 'Elements'}, {'value': 2.94, 'units': 'mg', 'description': 'Zinc, Zn', 'group': 'Elements'}, {'value': 0.024, 'units': 'mg', 'description': 'Copper, Cu', 'group': 'Elements'}, {'value': 0.021, 'units': 'mg', 'description': 'Manganese, Mn', 'group': 'Elements'}, {'value': 14.5, 'units': 'mcg', 'description': 'Selenium, Se', 'group': 'Elements'}, {'value': 1054.0, 'units': 'IU', 'description': 'Vitamin A, IU', 'group': 'Vitamins'}, {'value': 262.0, 'units': 'mcg', 'description': 'Retinol', 'group': 'Vitamins'}, {'value': 271.0, 'units': 'mcg_RAE', 'description': 'Vitamin A, RAE', 'group': 'Vitamins'}, {'value': 0.0, 'units': 'mg', 'description': 'Vitamin C, total ascorbic acid', 'group': 'Vitamins'}, {'value': 0.031, 'units': 'mg', 'description': 'Thiamin', 'group': 'Vitamins'}, {'value': 0.45, 'units': 'mg', 'description': 'Riboflavin', 'group': 'Vitamins'}, {'value': 0.18, 'units': 'mg', 'description': 'Niacin', 'group': 'Vitamins'}, {'value': 0.19, 'units': 'mg', 'description': 'Pantothenic acid', 'group': 'Vitamins'}, {'value': 0.074, 'units': 'mg', 'description': 'Vitamin B-6', 'group': 'Vitamins'}, {'value': 18.0, 'units': 'mcg', 'description': 'Folate, total', 'group': 'Vitamins'}, {'value': 0.27, 'units': 'mcg', 'description': 'Vitamin B-12', 'group': 'Vitamins'}, {'value': 0.0, 'units': 'mcg', 'description': 'Folic acid', 'group': 'Vitamins'}, {'value': 18.0, 'units': 'mcg', 'description': 'Folate, food', 'group': 'Vitamins'}, {'value': 18.0, 'units': 'mcg_DFE', 'description': 'Folate, DFE', 'group': 'Vitamins'}, {'value': 0.324, 'units': 'g', 'description': 'Tryptophan', 'group': 'Amino Acids'}, {'value': 0.896, 'units': 'g', 'description': 'Threonine', 'group': 'Amino Acids'}, {'value': 1.563, 'units': 'g', 'description': 'Isoleucine', 'group': 'Amino Acids'}, {'value': 2.412, 'units': 'g', 'description': 'Leucine', 'group': 'Amino Acids'}, {'value': 2.095, 'units': 'g', 'description': 'Lysine', 'group': 'Amino Acids'}, {'value': 0.659, 'units': 'g', 'description': 'Methionine', 'group': 'Amino Acids'}, {'value': 0.126, 'units': 'g', 'description': 'Cystine', 'group': 'Amino Acids'}, {'value': 1.326, 'units': 'g', 'description': 'Phenylalanine', 'group': 'Amino Acids'}, {'value': 1.216, 'units': 'g', 'description': 'Tyrosine', 'group': 'Amino Acids'}, {'value': 1.682, 'units': 'g', 'description': 'Valine', 'group': 'Amino Acids'}, {'value': 0.952, 'units': 'g', 'description': 'Arginine', 'group': 'Amino Acids'}, {'value': 0.884, 'units': 'g', 'description': 'Histidine', 'group': 'Amino Acids'}, {'value': 0.711, 'units': 'g', 'description': 'Alanine', 'group': 'Amino Acids'}, {'value': 1.618, 'units': 'g', 'description': 'Aspartic acid', 'group': 'Amino Acids'}, {'value': 6.16, 'units': 'g', 'description': 'Glutamic acid', 'group': 'Amino Acids'}, {'value': 0.439, 'units': 'g', 'description': 'Glycine', 'group': 'Amino Acids'}, {'value': 2.838, 'units': 'g', 'description': 'Proline', 'group': 'Amino Acids'}, {'value': 1.472, 'units': 'g', 'description': 'Serine', 'group': 'Amino Acids'}, {'value': 93.0, 'units': 'mg', 'description': 'Cholesterol', 'group': 'Other'}, {'value': 18.584, 'units': 'g', 'description': 'Fatty acids, total saturated', 'group': 'Other'}, {'value': 8.275, 'units': 'g', 'description': 'Fatty acids, total monounsaturated', 'group': 'Other'}, {'value': 0.83, 'units': 'g', 'description': 'Fatty acids, total polyunsaturated', 'group': 'Other'}]}]字典的鍵分別是'id', 'description', 'tags', 'manufacturer', 'group', 'portions', 'nutrients'。
?
其中nutrients一欄就含有N多內容,我們把文件第一項的nutrients一欄變成DataFrame格式看一下:
nutrients=pd.DataFrame(data[0]['nutrients'])?
nutrients的前5行顯示如下:
description group units value 0 Protein Composition g 25.180 1 Total lipid (fat) Composition g 29.200 2 Carbohydrate, by difference Composition g 3.060 3 Ash Other g 3.280 4 Energy Energy kcal 376.000?
可以看出,原文件包含的內容太多,而且現有的格式不方便做數據分析。因此,我們接下來提取需要的數據,并轉換其格式。
?
我們把'id', 'description', 'manufacturer', 'group'這四欄提取出來,并將其變為DataFrame格式:
info=pd.DataFrame(data, columns=['id', 'description', 'manufacturer', 'group'])?
這是info的前5行:
id description manufacturer \ 0 1008 Cheese, caraway 1 1009 Cheese, cheddar 2 1018 Cheese, edam 3 1019 Cheese, feta 4 1028 Cheese, mozzarella, part skim milk group 0 Dairy and Egg Products 1 Dairy and Egg Products 2 Dairy and Egg Products 3 Dairy and Egg Products 4 Dairy and Egg Products?
接下來讓我們看一下每個食物類別分別包含多少數量的食物:
group_count=info["group"].value_counts()?
這是group_count的前10行:
Vegetables and Vegetable Products 812 Beef Products 618 Baked Products 496 Breakfast Cereals 403 Fast Foods 365 Legumes and Legume Products 365 Lamb, Veal, and Game Products 345 Sweets 341 Fruits and Fruit Juices 328 Pork Products 328屬于蔬菜和蔬菜制品一類的食物是最多的。
?
但是info表沒有包含營養成分這一欄(我們就是要分析食物的營養成分不是嗎?),而nutrients表只有營養成分,卻沒有顯示其對應的食物。因此,我們需要把這兩張表結合起來。具體來說,就是先把每個食物的nutrients一欄提取出來,變成DataFrame格式,然后在上面添加對應的食物信息,最后把這些表用concat命令合并在一起。
nutrients=[]for rec in data:nutrient=pd.DataFrame(rec["nutrients"])nutrient["id"]=rec["id"]nutrient["food"]=rec["description"]nutrient["food_group"]=rec["group"]nutrients.append(nutrient)nutri_data=pd.concat(nutrients, ignore_index=True)?
nutri_data的前10行顯示如下:
description group units value id \ 0 Protein Composition g 25.18 1008 1 Total lipid (fat) Composition g 29.20 1008 2 Carbohydrate, by difference Composition g 3.06 1008 3 Ash Other g 3.28 1008 4 Energy Energy kcal 376.00 1008 5 Water Composition g 39.28 1008 6 Energy Energy kJ 1573.00 1008 7 Fiber, total dietary Composition g 0.00 1008 8 Calcium, Ca Elements mg 673.00 1008 9 Iron, Fe Elements mg 0.64 1008 food food_group 0 Cheese, caraway Dairy and Egg Products 1 Cheese, caraway Dairy and Egg Products 2 Cheese, caraway Dairy and Egg Products 3 Cheese, caraway Dairy and Egg Products 4 Cheese, caraway Dairy and Egg Products 5 Cheese, caraway Dairy and Egg Products 6 Cheese, caraway Dairy and Egg Products 7 Cheese, caraway Dairy and Egg Products 8 Cheese, caraway Dairy and Egg Products 9 Cheese, caraway Dairy and Egg Products這份數據文件每一列分別是:營養成分的名稱,營養成分的類別,營養成分的計量單位,營養成分的含量,營養成分所對應的食物id,食物名稱,食物類別。
?
接下來,我們先去除數據中的重復值和NA值,然后就可以開始進行分析了。
nutri_data=nutri_data.drop_duplicates() nutri_data=nutri_data[nutri_data.notnull()]?
比如,我們想要知道每個食物類別中各營養成分的中位數是多少,并從大到小進行排序。我們首先制作一個透視表,以食物類別為行,以營養成分為列,聚合函數為計算中位數:
nutrients_median=pd.pivot_table(nutri_data, values="value", index="food_group", columns="description", aggfunc="median")?
這里選取鋅元素(Zinc)在各食物類別中的含量中位數進行排序:
zinc_by_foodgroup=nutrients_median["Zinc, Zn"].sort_values(ascending=False) food_group Beef Products 5.390 Lamb, Veal, and Game Products 3.940 Nut and Seed Products 3.290 Breakfast Cereals 2.885 Spices and Herbs 2.750 Poultry Products 2.500 Pork Products 2.320 Sausages and Luncheon Meats 2.130 Snacks 1.470 Dairy and Egg Products 1.390 Fast Foods 1.250 Legumes and Legume Products 1.140 Cereal Grains and Pasta 1.090 Ethnic Foods 1.045 Restaurant Foods 0.800 Finfish and Shellfish Products 0.670 Baked Products 0.660 Meals, Entrees, and Sidedishes 0.630 Baby Foods 0.590 Sweets 0.360 Vegetables and Vegetable Products 0.330 Soups, Sauces, and Gravies 0.200 Fruits and Fruit Juices 0.100 Beverages 0.040 Fats and Oils 0.020 Name: Zinc, Zn, dtype: float64?
將其畫成柱形圖:
ax.barh(range(25),zinc_by_foodgroup.values[::-1]) ax.set_yticks(range(25)) ax.set_xticks([i for i in range(7)]) ax.set_yticklabels(zinc_by_foodgroup.index.values[::-1])plt.show()牛肉制品的鋅含量中位數是最高的。
?
如果我們想知道各營養成分在哪種食物中含量最高呢?首先,我們以營養成分的類別和營養成分為行進行分組,并以食物為列,制作一個透視表。將此透視表轉置,我們就可以輕松選取各營養成分的類別數據,在選中的營養成分的類別上使用idxmax()命令,就可以找出數值最大所對應的食物是哪個了。(注:idxmax()用于DataFrame,argmax()用于Series)
table=pd.pivot_table(nutri_data, values="value", index=["group","description"], columns="food") max_amino_acids=table.T["Amino Acids"].idxmax()?
這里選取Amino Acids這一類別,可以看到第一行營養成分Alanine(丙氨酸)在Gelatins, dry powder, unsweetened食物內含量最高。
description Alanine Gelatins, dry powder, unsweetened Arginine Seeds, sesame flour, low-fat Aspartic acid Soy protein isolate Cystine Seeds, cottonseed flour, low fat (glandless) Glutamic acid Soy protein isolate Glycine Gelatins, dry powder, unsweetened Histidine Whale, beluga, meat, dried (Alaska Native) Hydroxyproline KENTUCKY FRIED CHICKEN, Fried Chicken, ORIGINA... Isoleucine Soy protein isolate, PROTEIN TECHNOLOGIES INTE... Leucine Soy protein isolate, PROTEIN TECHNOLOGIES INTE... Lysine Seal, bearded (Oogruk), meat, dried (Alaska Na... Methionine Fish, cod, Atlantic, dried and salted Phenylalanine Soy protein isolate, PROTEIN TECHNOLOGIES INTE... Proline Gelatins, dry powder, unsweetened Serine Soy protein isolate, PROTEIN TECHNOLOGIES INTE... Threonine Soy protein isolate, PROTEIN TECHNOLOGIES INTE... Tryptophan Sea lion, Steller, meat with fat (Alaska Native) Tyrosine Soy protein isolate, PROTEIN TECHNOLOGIES INTE... Valine Soy protein isolate, PROTEIN TECHNOLOGIES INTE... dtype: object?
轉載于:https://www.cnblogs.com/HuZihu/p/10163341.html
總結
以上是生活随笔為你收集整理的数据分析---《Python for Data Analysis》学习笔记【04】的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Turtle-可视化界面画圣诞树
- 下一篇: P2016 战略游戏