본문 바로가기

IT.모바일/배움

Wide data multiple columns & Long data multiple rows

by FrankUniq 2023. 6. 27.
SMALL

 

  • Wide data subjects can have data in multiple columns.
  • Long data subjects can have multiple rows that hold the values of subject attributes.

Here are examples of wide and long data formats using a dataset of student test scores:

Wide data format:

Student Name ID Number Math Score English Score Science Score
Alice 1 90 85 95
Bob 2 80 75 85
Charlie 3 70 65 75

In this wide data format, each row represents a single student, and the columns represent the student's name, ID number, and test scores in different subjects.

Long data format:

Student Name ID Number Subject Test Score
Alice 1 Math 90
Alice 1 English 85
Alice 1 Science 95
Bob 2 Math 80
Bob 2 English 75
Bob 2 Science 85
Charlie 3 Math 70
Charlie 3 English 65
Charlie 3 Science 75

In this long data format, each row represents a single test score for a single student, with columns for the student's name, ID number, subject, and test score.

 

Googld Advanced Data Analytics | Foundations of Data Science | Week 1 Quiz

댓글