[Memo] I tried a pivot table in Python

Introduction

Pivot tables are often used on the shop floor when analyzing large amounts of data in Excel. This is convenient when you want to aggregate data exploratively. Isn't it possible to have a pivot table with Jupyter Notebook? When I was looking into it, I found that I could do it by using a library called pivottablejs.

Pivot table implementation

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

#Data set loading
df=sns.load_dataset('tips')

pivottablejs.pivot_ui(df)

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

You can do aggregation by dragging and dropping. It's very convenient because you can do it in the same way as Excel.

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

Recommended Posts

[Memo] I tried a pivot table in Python
A memo that I wrote a quicksort in Python
I tried playing a typing game in Python
I tried adding a Python3 module in C
I tried Line notification in Python
I tried to implement a one-dimensional cellular automaton in Python
I tried "a program that removes duplicate statements in Python"
I tried "How to get a method decorated in Python"
I created a class in Python and tried duck typing
I tried to make a stopwatch using tkinter in python
I tried to implement PLSA in Python
I tried to implement permutation in Python
I made a payroll program in Python!
I tried to implement PLSA in Python 2
I tried using Bayesian Optimization in Python
I tried to implement ADALINE in Python
I tried a functional language with Python
I tried to implement PPO in Python
I tried using pipenv, so a memo
I created a password tool in Python.
[Python] A memo that I tried to get started with asyncio
I tried to implement a misunderstood prisoner's dilemma game in Python
When I tried to scrape using requests in python, I was addicted to SSLError, so a workaround memo
I tried the pivot table function of pandas
I want to create a window in Python
I tried Python> autopep8
I tried simulating the "birthday paradox" in Python
I tried the least squares method in Python
I wrote a class in Python3 and Java
A memo about writing merge sort in Python
I want to convert a table converted to PDF in Python back to CSV
I tried to implement TOPIC MODEL in Python
I tried reading a CSV file using Python
I tried to develop a Formatter that outputs Python logs in JSON
I tried non-blocking I / O Eventlet behavior in Python
I tried running alembic, a Python migration tool
I tried to implement selection sort in python
I tried Python> decorator
I tried to implement a card game of playing cards in Python
I made a Caesar cryptographic program in Python.
I tried to create a class that can easily serialize Json in Python
I tried to implement what seems to be a Windows snipping tool in Python
Draw a graph in Julia ... I tried a little analysis
I tried to graph the packages installed in Python
I want to embed a variable in a Python string
I want to easily implement a timeout in python
I tried to create a table only with Django
I made a prime number generation program in Python
I tried using TradeWave (BitCoin system trading in Python)
I tried to draw a route map with Python
I want to write in Python! (2) Let's write a test
I tried running python etc. from a bat file
I want to randomly sample a file in Python
I tried to implement Dragon Quest poker in Python
I want to work with a robot in python.
I tried to implement GA (genetic algorithm) in Python
I tried to automatically generate a password with Python3
I tried to summarize how to use pandas in python
[Python] I tried running a local server using flask
A memo that I touched the Datastore with python
I tried drawing a pseudo fractal figure using Python