Great. After loading the data, the first thing you want to do is take a peek at the data. We can use the
tail() functions to quickly see the first/last five rows of our DataFrame.
Mind the syntax. We put the variable name
hospitals, followed by a dot (
.) and the pandas function
head(). The dot syntax means that we want to execute the
head() function on the variable named
The code above will show the following:
||Hospital overall rating
||Abbeville Area Medical Center
||Abbeville General Hospital
||Avera St Lukes
||Sanford Aberdeen Medical Center
||Grays Harbor Community Hospital
The data appear to be correct. Note that the first column contains consecutive numbers, but does not have a name. It's called a sequential index.
pandas has created it for us automatically.