Summary : in this tutorial, you’ll learn about the axes and labels in Pandas.
NumPy can be used to perform calculations on multi-dimensional arrays and matrices. Our data is normally available in tabular form, which can be represent in 2-dimensional array, equivalent to 2 axis.
The term axes in Pandas refer to the columns and the row index, as shown in the picture above.
The index is axis 0 and the columns are axis 1. Both are stored in
Index objects and are immutable, meaning they cannot be changed once created.
The labels in pandas allows for quick and easy access to rows and columns data using names instead of numbers.
Code language: Python (python)
# Subset a single column by column name df["colB"] df.colA # Accessing a single element in a DataFrame df["colB"]["R3"], df["colB"]