Working with arrays
Once NumPy arrays are created or loaded, there are basically three things that we can do with them:
Selection consists of accessing one or several elements within an array. It can be done with NumPy or Pandas.
Let's continue with our example data opened with Pandas. Each column of the
data object of
DataFrame can be accessed through its name. In IPython, tab completion proposes the different columns of the data. In the following example, we get the names of all cities (
AccentCity is the full name of the city, with uppercase characters and accents):
In : data.AccentCity Out: 0 Aixas 1 Aixirivali ... 3173956 Zuzumba 3173957 Zvishavane Name: AccentCity, Length: 3173958 ...