Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction to data frames
Data frame structure
Accessing columns in a data frame
Accessing rows of a data frame
Accessing rows and columns combined in a data frame
Data frame analysis
Summary

Instruction

Well done! We used the dollar sign ($) to retrieve a column name in the previous exercise:

cities[cities$country == "Germany", ]

Of course, it would also be okay to fetch a column like this:

cities[cities["country"] == "Germany", ]

Here, we simply retrieved the column by passing in its name as a string to the bracket operator. Both expressions are fine and will give you the same result. However, in our next examples, we will continue to use the $ sign for better readability and transparency.

Exercise

Click Next exercise to move on.