Preview your data
A DataFrame stores data in rows and columns. head() returns the first five rows unless you give it a different number.
| index | name | score |
|---|---|---|
| 0 | Ari | 12 |
| 1 | Bo | 18 |
| 2 | Cam | 9 |
| index | name | score |
|---|---|---|
| 0 | Ari | 12 |
| 1 | Bo | 18 |
Inspect rows, columns, and the size of a Pandas DataFrame.
Step 1 of 3 · Learn
A DataFrame stores data in rows and columns. head() returns the first five rows unless you give it a different number.
| index | name | score |
|---|---|---|
| 0 | Ari | 12 |
| 1 | Bo | 18 |
| 2 | Cam | 9 |
| index | name | score |
|---|---|---|
| 0 | Ari | 12 |
| 1 | Bo | 18 |
shape returns a pair: the number of rows, then the number of columns. The index labels are not counted as a data column.
| index | name | score |
|---|---|---|
| 0 | Ari | 12 |
| 1 | Bo | 18 |
| 2 | Cam | 9 |
(3, 2)
Return the first five rows of searches, keeping all columns and their original order. Save the DataFrame as result.
Loading Python and Pandas…
Run the code to see DataFrame results here.