Similar to the way dictionaries use keys to address a value, pandas dataframes use row labels—the dataframe index—and column labels to access individual values:
AF.loc['R1', 'C2'] # this returns 2.0
Or to generate a subframe:
AF.loc[['R1','R2'],['C1','C2']]
Resulting in:
C1 C2
R1 1 2.0
R2 4 5.0
You can also address a complete row by using the index label:
AF.loc['R1']
This returns a pandas Series object:
C1 1.0
C2 2.0
C3 3.0
Name: R1, dtype: float64
If loc or iloc are called with list arguments or slices, the result is a dataframe.
In that way, an individual dataframe element can also be addressed as follows:
AF.loc['R1'].loc['C1'] # returns 1.0
An entire column is addressed directly as follows:
AF['C1']
This again returns a pandas Series object:
R1 1.0
R2 4.0
Name: C1, dtype: float64
Alternatively...