July 2019
Beginner to intermediate
740 pages
16h 52m
English
First, we want to make sure that we actually have data in our dataframe. We can check the empty attribute for this answer:
>>> df.emptyFalse
So far, so good; we have data. Next, we should check how much data we read in; we want to know the number of observations (rows) and the number of variables (columns) we have. For this task, we use the shape attribute:
>>> df.shape(9332, 26)
Our data has 9,332 observations of 26 variables, which matches our inspection of the file before we read it in, but what does our data actually look like? For this task, we can use the head() and tail() methods to look at the top and bottom rows, respectively. This will default to five rows, but we can change this by passing a different number ...
Read now
Unlock full access