LoginSignup
0
4

More than 3 years have passed since last update.

【メモ】Pythonでピボットテーブルをやってみた

Posted at
  • 製造業出身のデータサイエンティストがお送りする記事
  • 今回は自分のメモとして記事に残しておきます。

はじめに

製造現場では、膨大なデータをExcelで分析する際にピボットテーブルを頻繁に使います。データを探索的に集計したいときに便利だからです。
Jupyter Notebookでもピボットテーブルってできないのかな?と思って調べていたらpivottablejsというライブラリーを使用したらできるということが分かりました。

ピボットテーブルの実装

import pivottablejs
import seaborn as sns
sns.set_style('whitegrid')

#データセットの読み込み
df=sns.load_dataset('tips')

pivottablejs.pivot_ui(df)

スクリーンショット 2021-01-06 14.41.56.png

集計とかはドラック&ドロップでできます。
Excelと同じような感じでできますので、非常に便利です。

スクリーンショット 2021-01-06 14.43.30.png

0
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
4