Pivot

SQL

SQL - PIVOT and UNPIVOT

PIVOT transforms rows into columns by rotating data around a pivot point. The operation requires three components: an aggregate function, a column to aggregate, and a column whose values become new…

Read more →
Pandas

Pandas - Pivot Table with Examples

A pivot table reorganizes data from a DataFrame by specifying which columns become the new index (rows), which become columns, and what values to aggregate. The fundamental syntax requires three…

Read more →
Pandas

How to Pivot a DataFrame in Pandas

Pivoting transforms data from a ’long’ format (many rows, few columns) to a ‘wide’ format (fewer rows, more columns). If you’ve ever received transactional data where each row represents a single…

Read more →
Python

How to Pivot a DataFrame in Polars

Pivoting transforms your data from long format to wide format—rows become columns. It’s one of those operations you’ll reach for constantly when preparing data for reports, visualizations, or…

Read more →
MySQL

How to Create Pivot Tables in MySQL

Pivot tables transform row-based data into columnar summaries, converting unique values from one column into multiple columns with aggregated data. If you’ve worked with Excel pivot tables, the…

Read more →