理想の国pandas練習問題5


需要
今、私たちは世界のスターバックスの店舗に関する統計データを持っています.もし私がアメリカのスターバックスの数と中国のどれが多いか、あるいは中国の省ごとにスターバックスの数を知りたいなら、どうすればいいですか.
データソース:https://www.kaggle.com/starbucks/store-locations/data
データ取得
ファイルからスターバックス店舗データを読み込む
#          
starbucks = pd.read_csv("./data/starbucks.csv")

グループ化の集約
#       ,               
count = starbucks.groupby(['Country']).count()

グラフ表示結果
count['Brand'].plot(kind='bar', figsize=(20, 8))
plt.show()

私たちが省市に参加してグループ化するとします.
#       ,set_index()
starbucks.groupby(['Country', 'State/Province']).count()

starbucks.csv
Brand,Store Number,Store Name,Ownership Type,Street Address,City,State/Province,Country,Postcode,Phone Number,Timezone,Longitude,Latitude
Starbucks,47370-257954,"Meritxell, 96",Licensed,"Av. Meritxell, 96",Andorra la Vella,7,AD,AD500,376818720,GMT+1:00 Europe/Andorra,1.53,42.51
Starbucks,22331-212325,Ajman Drive Thru,Licensed,"1 Street 69, Al Jarf",Ajman,AJ,AE,,,GMT+04:00 Asia/Dubai,55.47,25.42
Starbucks,47089-256771,Dana Mall,Licensed,Sheikh Khalifa Bin Zayed St.,Ajman,AJ,AE,,,GMT+04:00 Asia/Dubai,55.47,25.39
Starbucks,22126-218024,Twofour 54,Licensed,Al Salam Street,Abu Dhabi,AZ,AE,,,GMT+04:00 Asia/Dubai,54.38,24.48
Starbucks,17127-178586,Al Ain Tower,Licensed,"Khaldiya Area, Abu Dhabi Island",Abu Dhabi,AZ,AE,,,GMT+04:00 Asia/Dubai,54.54,24.51
Starbucks,17688-182164,"Dalma Mall, Ground Floor",Licensed,"Dalma Mall, Mussafah",Abu Dhabi,AZ,AE,,,GMT+04:00 Asia/Dubai,54.49,24.4
Starbucks,18182-182165,"Dalma Mall, Level 1",Licensed,"Dalma Mall, Mussafah",Abu Dhabi,AZ,AE,,,GMT+04:00 Asia/Dubai,54.49,24.4
Starbucks,23359-229184,Debenhams Yas Mall,Licensed,Yas Island,Abu Dhabi,AZ,AE,,,GMT+04:00 Asia/Dubai,54.61,24.46
Starbucks,30781-99022,Khalidiya Street,Licensed,Khalidiya St.,Abu Dhabi,AZ,AE,,26670052,GMT+04:00 Asia/Muscat,55.69,24.19
Starbucks,20423-205465,Eastern Mangroves,Licensed,"Al Salam Street, The Mangroves",Abu Dhabi,AZ,AE,,,GMT+04:00 Asia/Dubai,54.38,24.48
Starbucks,20424-205466,Nation Towers,Licensed,Corniche Street,Abu Dhabi,AZ,AE,,,GMT+04:00 Asia/Dubai,54.34,24.47
Starbucks,1579-122101,HCT Abu Dhabi Women's College Block,Licensed,"Najda Street, Higher Colleges of Technology",Abu Dhabi,AZ,AE,3167,26426280,GMT+04:00 Asia/Dubai,54.37,24.49
Starbucks,32595-122105,Standard Chartered Building,Licensed,"Khalidiya St., Beside Union Cooperative Society",Abu Dhabi,AZ,AE,3167,26359275,GMT+04:00 Asia/Muscat,55.69,24.19
Starbucks,24191-236428,International Tower,Licensed,"Capital Center, Adnec, Abu Dhabi",Abu Dhabi,AZ,AE,,,GMT+04:00 Asia/Dubai,54.7,24.3
Starbucks,24604-238367,Yas Mall 3,Licensed,YAS Island,Abu Dhabi,AZ,AE,,,GMT+04:00 Asia/Dubai,54.6,24.48
Starbucks,32029-110804,Blue Tower A,Licensed,"Street No.4, Muroor Road, Ground Floor",Abu Dhabi,AZ,AE,,26429255,GMT+04:00 Asia/Muscat,55.74,24.21
Starbucks,29560-238539,Corniche Park DT,Licensed,"Corniche  Road , Abu Dhabi",Abu Dhabi,AZ,AE,,,GMT+04:00 Asia/Dubai,54.34,24.47
Starbucks,32239-100001,Khalidiya Mall,Licensed,"Street No.26 of Khalidiya Area, Ground Floor, Shop No. A11",Abu Dhabi,AZ,AE,,26354740,GMT+04:00 Asia/Dubai,54.35,24.47
Starbucks,31719-103601,Al Wahda Mall,Licensed,"11th Street, Ground Floor, Main Entrance",Abu Dhabi,AZ,AE,,24437197,GMT+04:00 Asia/Dubai,54.37,24.47
Starbucks,20008-200004,Al Seef Village,Licensed,"Salam Street, Ministries District",Abu Dhabi,AZ,AE,,,GMT+04:00 Asia/Dubai,54.38,24.48
Starbucks,32767-131566,Shangri-La Souq,Licensed,"Shangri-La Souk, Um Al Nar",Abu Dhabi,AZ,AE,3167,25581641,GMT+04:00 Asia/Dubai,54.51,24.42
Starbucks,3886-141408,"Abu Dhabi University, Men's",Licensed,"Muroor Street, Abu Dhabi Mall",Abu Dhabi,AZ,AE,,24433824,GMT+04:00 Asia/Dubai,54.35,24.46
Starbucks,29539-254261,MUshrif Mall 1,Licensed,"25th st, Airport Road",Abu Dhabi,AZ,AE,971,,GMT+04:00 Asia/Dubai,54.66,24.41
Starbucks,28809-251348,Boutik Mall Sun & Sky,Licensed,"Shams Abu Dhabi, Al Reem Island",Abu Dhabi,AZ,AE,,,GMT+04:00 Asia/Dubai,54.41,24.5
Starbucks,34262-62540,Marina Mall,Licensed,Marina Mall,Abu Dhabi,AZ,AE,,02-6815883,GMT+04:00 Asia/Dubai,54.32,24.47
Starbucks,3178-141407,"Abu Dhabi University, Women's",Licensed,"Road Al Ain Abu Dhabi Road Number 22, Women Side",Abu Dhabi,AZ,AE,,25860492,GMT+04:00 Asia/Dubai,54.57,24.35
Starbucks,34260-17877,Hamdan Street,Licensed,Hamdan Street,Abu Dhabi,AZ,AE,,02-6261001,GMT+04:00 Asia/Muscat,55.62,24.21
Starbucks,21605-213406,Saadiyat Island,Licensed,Saadiyat Island,Abu Dhabi,AZ,AE,,,GMT+04:00 Asia/Dubai,54.44,24.54
Starbucks,1935-141406,Camellia Flowers,Licensed,"Khalidiya Area Khalidiya street, Behind Union Bank and Finance House",Abu Dhabi,AZ,AE,,02-6355542,GMT+04:00 Asia/Dubai,54.34,24.47
Starbucks,20113-195784,Deerfields,Licensed,"Sheikh Zayed Road, Al Bahia Area",Abu Dhabi,AZ,AE,,,GMT+04:00 Asia/Dubai,54.94,24.9
Starbucks,34227-33225,Abu Dhabi Mall,Licensed,"Al Salam Street, Tourist Club Area",Abu Dhabi,AZ,AE,,02-6454914,GMT+04:00 Asia/Dubai,54.37,24.5
Starbucks,17361-180588,Zayed University,Licensed,Corner of 16th Street and Aiport Road,Abu Dhabi,AZ,AE,,,GMT+04:00 Asia/Dubai,54.6,24.4
Starbucks,15938-165686,Bawabat Al Sharq,Licensed,Corner Al Ain Rd & Baniyas Rd,Abu Dhabi,AZ,AE,,,GMT+04:00 Asia/Muscat,55.77,24.48
Starbucks,16453-170544,Guardian Tower,Licensed,"31st Street, Danat Abu Dhabi",Abu Dhabi,AZ,AE,,02 6414214,GMT+04:00 Asia/Dubai,54.44,24.43
Starbucks,24085-235545,Ferrari World Welcome Pavilion,Licensed,Yas Island,Abu Dhabi,AZ,AE,,,GMT+04:00 Asia/Dubai,54.61,24.46
Starbucks,24932-239347,Al Mamoura,Licensed,"Al Mamoura, Al Muroor District",Abu Dhabi,AZ,AE,51133,,GMT+04:00 Asia/Dubai,54.39,24.46
Starbucks,18469-188844,Ministry of Interior,Licensed,Khaleej Al Arabi Street,Abu Dhabi,AZ,AE,,,GMT+04:00 Asia/Dubai,54.39,24.43
Starbucks,28810-251346,ADNOC Mushrif,Licensed,Airport Road,Abu Dhabi,AZ,AE,,,GMT+04:00 Asia/Dubai,54.66,24.41
Starbucks,1897-120044,Twin Towers 13th Street,Licensed,"3th street Abudhabi (Al Najda Street), Beside Al Masood Nissan Show Room",Abu Dhabi,AZ,AE,,26430239,GMT+04:00 Asia/Dubai,55.53,23.85
Starbucks,20772-207664,Al Falah Community,Licensed,Al Falah Village 2 Centre,Abu Dhabi,AZ,AE,,,GMT+04:00 Asia/Dubai,54.37,24.47
Starbucks,2176-143834,Abu Dhabi Police HQ,Licensed,13th Street,Abu Dhabi,AZ,AE,,02 4093231,GMT+04:00 Asia/Dubai,54.37,24.52
Starbucks,18530-169885,Western Region,Licensed,"Liwa Road, Madinat Zayed",Abu Dhabi,AZ,AE,,,GMT+04:00 Asia/Dubai,54.37,24.48
Starbucks,24931-239348,Raha Garden,Licensed,Raha Gardens Plaza,Abu Dhabi,AZ,AE,51133,,GMT+04:00 Asia/Dubai,54.37,24.47
Starbucks,29306-253248,Al Ain Ladies Club,Licensed,"Al Markhaniya , Al Ain, Al Markhaniya, Al Ain",Al Ain,AZ,AE,,,GMT+04:00 Asia/Muscat,55.4,24.12
Starbucks,17291-169884,Jahli Park,Licensed,"Sheikh Khalifa Bin Zayed Road, Jahli",Al Ain,AZ,AE,,,GMT+04:00 Asia/Dubai,55.29,25.24
Starbucks,32640-131563,Tawam Hospital,Licensed,"Al Ain Abu Dhabi Rd, Khalifa Bin Zayed, Al Makam Area",Al Ain,AZ,AE,3167,37677581,GMT+04:00 Asia/Muscat,55.65,24.19
Starbucks,34332-97778,Jimmy Mall,Licensed,"Baladia Road, Opposite Passport Office",Al Ain,AZ,AE,,37627680,GMT+04:00 Asia/Muscat,55.73,24.24
Starbucks,16257-166109,Al Ain Mall,Licensed,City Road,Al Ain,AZ,AE,,03 7849281,GMT+04:00 Asia/Dubai,55.39,25.1
Starbucks,1926-141411,Bawadi Mall,Licensed,Maziad Road After Hilton Roundabout,Al Ain,AZ,AE,,37840012,GMT+04:00 Asia/Muscat,55.81,24.16
Starbucks,24510-238164,Wahat Hili Mall,Licensed,"Unit RA 029, Wahat Hili Mall, Baniyas Street, Hili District",Al Ain,AZ,AE,,,GMT+04:00 Asia/Muscat,55.69,24.21
Starbucks,17788-183965,Oasis Hospital,Licensed,"Al Ain Street, Al Jahli",Al Ain,AZ,AE,,,GMT+04:00 Asia/Muscat,55.8,24.13
Starbucks,22963-226644,YAS Mall,Licensed,"Yas Island, Abu Dhabi",Abu Dhabi,DU,AE,,,GMT+04:00 Asia/Dubai,54.47,24.41
Starbucks,23197-228761,Al Ruwais Mall,Licensed,Al Ruwais,Abu Dhabi,DU,AE,,,GMT+04:00 Asia/Dubai,54.63,24.29
Starbucks,23549-231166,Shamkha Mall,Licensed,Al Shamkha,Abu Dhabi,DU,AE,,,GMT+04:00 Asia/Dubai,54.69,24.39