Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Exploratory Hour #41 データを集計したい

Takato Shiroto
December 03, 2019

Exploratory Hour #41 データを集計したい

2019/12/3(水)に行ったExploratory Hourのスライドです。
このスライドでは、集計 (Summarize)の基本的な使い方とよく使う関数について紹介しています。

Takato Shiroto

December 03, 2019
Tweet

More Decks by Takato Shiroto

Other Decks in Science

Transcript

  1. 2 εϐʔΧʔ നށ ܟొ Customer Succes EXPLORATORY ུྺ େֶࡏֶதʹϑʔυϩεΛݮΒͨ͢ΊʹɺֶੜஂମΛ্ཱͪ͛୅දΛ ຿ΊΔɻͦͷޙɺϏδωεΛ஌ΔͨΊʹԽֶϝʔΧʔͷσϡϙϯͱ

    ϑʔυςοΫܥελʔτΞοϓͰӦۀͱϚʔέςΟϯάΛܦݧɻΞϓ Ϧͷ੒௕ͷͨΊʹ͸σʔλαΠΤϯε͕ඞཁͩͱײ͡ɺΞϓϦʹಛԽ ͨ͠Ϣʔβʔͷߦಈ෼ੳπʔϧΛ։ൃ͢ΔاۀʹͯɺΞϓϦۀքͷ KPI෼ੳͳͲΛ୲౰͢Δɻݱࡏ͸Exploratory, Inc. ͰΧελϚʔαΫη εΛ୲౰͢Δ๣ΒɺσʔλͷՄࢹԽͱ୳ࡧతσʔλ෼ੳΛઐ໳ͱͯ͠ σʔλαΠΤϯεͷීٴʹऔΓ૊Ήɻ @ShirotoTakato
  2. Customer Name Sales Mike 34 Mike 26 Mike 36 5

    ܭࢉΛ࡞੒ͷ৔߹͸1ߦ1ߦʹܭࢉ݁ՌΛฦ͢ ྫɿܭࢉΛ࡞੒ʢMutateʣ Customer Name Counts Sales_avg Mike 3 32 Mike 3 32 Mike 3 32
  3. Customer Name counts Sales_avg Mike 3 32 Customer Name Sales

    Mike 34 Mike 26 Mike 36 6 ूܭͷ৔߹͸ɺάϧʔϓ͝ͱʹ·ͱΊͯ1ߦʹܭࢉ݁ՌΛฦ͢ ྫɿूܭʢSummarizeʣ
  4. ؔ਺ ఠཁ sum άϧʔϓͷதͷ஋ͷ߹ܭ n άϧʔϓͷதͷߦ਺ n_distinct άϧʔϓͷதͷҰҙͷ஋ͷ਺ mean άϧʔϓͷฏۉ஋

    median άϧʔϓͷதԝ஋ min άϧʔϓ಺ͷ࠷খ஋ max άϧʔϓ಺ͷ࠷େ஋ first άϧʔϓͷ࠷ॳͷ஋ last άϧʔϓͷ࠷ޙͷ஋ ूܭ ؔ਺ 8
  5. ؔ਺ ఠཁ nth άϧʔϓͷN൪໨ͷ஋ sd άϧʔϓͷඪ४ภࠩ var άϧʔϓͷ෼ࢄ IQR άϧʔϓͷ̐෼Ґൣғ(75%఺͔Β25%఺·Ͱ)

    mad άϧʔϓͷฏۉઈରภࠩ na_count άϧʔϓ಺ͷܽଛ஋ͷ਺ na_percent άϧʔϓ಺ͷܽଛ஋ͷׂ߹ ूܭ ؔ਺ 9
  6. Customer Name Country Mike China Mike Japan Mike Japan Tom

    US Tom Japan Tom US Customer Name Country Mike ??? Tom ??? ࠃ͸ΧςΰϦܕͷͨΊूܭͰ͖ͳ͍ʁ
  7. Customer Name Country Mike China Mike Japan Mike Japan Tom

    US Tom Japan Tom US Customer Name Country_mode Mike Japan Tom US ࠷ස஋ʢmodeʣ
  8. Customer Name Order Date Mike 2015-12-3 Mike 2014-7-14 Mike 2015-12-24

    Customer Name ։࢝೔ Mike 2015-12-3 ࠷ॳͷ஋(first)ͷ৔߹
  9. Customer Name Order Date Mike 2015-12-3 Mike 2014-7-14 Mike 2015-12-24

    Customer Name ։࢝೔ Mike 2014-7-14 ࠷খ஋(min)ͷ৔߹
  10. Customer Name Returned Mike TRUE Mike FALSE Mike TRUE Customer

    Name ฦ඼཰ Mike 0.6666 TRUEͷׂ߹ (%)ͷ৔߹
  11. Q&A