Value Counts and Bar Charts

Now we learn how to identify the values that occur repeatedly, in a column of a data frame. For our example, we will study which state has the largest number of airports. (We will not pay attention to the city, in this example.) How many airports are located in that state? We can figure this out, by writing:

myDF['state']

and then the value_counts function gives the number of airports in each state:

myDF['state'].value_counts()

Finally, we can make a plot of the value counts for the airports example!