October 2019
Beginner to intermediate
674 pages
16h 43m
English
The .loc operator supports pure label-based indexing. It accepts the following as valid inputs:
Let's examine each of these four cases with respect to the following two Series—one with an integer-based label and another with a string-based label:
ser_loc1 = pd.Series(np.linspace(11, 15, 5))ser_loc2 = pd.Series(np.linspace(11, 15, 5), index = list("abcde"))# Indexing with single labelIn: ser_loc1.loc[2] ...Read now
Unlock full access