さらに役立つ要約ツール

スプレッドシートユーザーのための Python

Chris Cardillo

Data Scientist

.mean()

fruit_sales.groupby('store', as_index=False).mean()

果物店の平均売上.png

スプレッドシートユーザーのための Python

解法の手順

  1. 果物店の取引
  2. 店舗ごとの果物別売上合計
  3. 店舗ごとの果物別売上の並べ替え
  4. 店舗ごとの先頭行
スプレッドシートユーザーのための Python

1: 果物店の取引

多数の果物販売.png

スプレッドシートユーザーのための Python

2: 店舗ごとの果物別売上合計

totals = fruit_sales.groupby(['store', 'product_name'], as_index=False).sum()

グループ化と集計.png

スプレッドシートユーザーのための Python

3: 店舗ごとの果物別売上の並べ替え

totals = (totals.sort_values('revenue', ascending=False)
.reset_index(drop=True))

合計の並べ替え.png

スプレッドシートユーザーのための Python

4: 店舗ごとの先頭行

top_store_sellers = totals.groupby('store').head(1).reset_index(drop=True)

最上位の総売上の食料品.png

スプレッドシートユーザーのための Python

解法の手順

# Raw data
fruit_sales

# Summary - by fruit by store
totals = fruit_sales.groupby(['store', 'product_name'], as_index=False).sum()

# Sort the Summary
totals = (totals.sort_values('revenue', ascending=False)
.reset_index(drop=True))

# First row for each store
top_store_sellers = totals.groupby('store').head(1).reset_index(drop=True)

最上位の総売上の食料品.png

スプレッドシートユーザーのための Python

解法の手順

1: 生取引データ

多数の果物販売.png

2: 果物/店舗別の要約

グループ化と集計.png

スプレッドシートユーザーのための Python

解法の手順

2: 果物/店舗別の要約

グループ化と集計.png

3: 果物/店舗別の並べ替え

合計の並べ替え.png

スプレッドシートユーザーのための Python

解法の手順

3: 果物/店舗別の並べ替え

合計の並べ替え.png

4: 店舗ごとの先頭行

最上位の総売上の食料品.png

スプレッドシートユーザーのための Python

あなたの番です!

スプレッドシートユーザーのための Python

Preparing Video For Download...