Pandas · Meet a DataFrame
Google Search Analytics
Course overviewGoogle Search · Work with DataFrames

Meet a DataFrame

Inspect rows, columns, and the size of a Pandas DataFrame.

Step 1 of 3 · Learn

Preview your data

A DataFrame stores data in rows and columns. head() returns the first five rows unless you give it a different number.

indexnamescore
0Ari12
1Bo18
2Cam9
indexnamescore
0Ari12
1Bo18
The first two rows, with all columns retained.

Check the table size

shape returns a pair: the number of rows, then the number of columns. The index labels are not counted as a data column.

indexnamescore
0Ari12
1Bo18
2Cam9
(3, 2)
Three rows and two columns.
▷ Your turn

Return the first five rows of searches, keeping all columns and their original order. Save the DataFrame as result.

LANGUAGEPython · Pandas

Loading Python and Pandas…

Run the code to see DataFrame results here.