Wide Format
noun
say it: “WYDE FOR-mat” /ˈwaɪd ˈfɔrmæt/
A way of laying out a table where one kind of value is spread across many columns, such as a column for each month.
What is wide format for a table?
A table in wide format spreads one kind of value across many columns, such as a column for each quiz. It's quick
for people to read, but hard to filter and group, so melt() turns it into long format.
import pandas as pd
wide = pd.DataFrame({"student_id": [101, 102], "quiz1": [88, 92], "quiz2": [90, 85]})
print(wide)
# student_id quiz1 quiz2
# 0 101 88 90
# 1 102 92 85
In a sentence
- “People read wide format easily, but code filters and groups long format more easily.”
- “The gradebook was in wide format, with a column for every quiz.”
Level: Apprentice · More Python terms at this level
Updated