Label-Based Indexing (Loc) : DF - Loc (Row Label(s), Column Label(s) )
Label-Based Indexing (Loc) : DF - Loc (Row Label(s), Column Label(s) )
Label-Based Indexing (Loc) : DF - Loc (Row Label(s), Column Label(s) )
d f . l o c [r o w l a b e l (s ) , c o l u m n l a b e l (s ) ]
column labels
row labels
Label-based Indexing (loc) – Example 1
d f . l o c [ [ “ N e y m a r J u n i o r ” , “ Ky l i a n M b a p p e ” ] , “ C l u b ” :]
Output is a DataFrame.
Label-based Indexing (loc) – Example 3
all columns
d f . l o c [ “ L i o n e l M e s s i ” : “ N e y m a r J u n i o r ” , :]
inclusive inclusive
Output is a DataFrame.
Label-based Indexing (loc) – Example 4
d f . l o c [: “ Ky l i a n M b a p p e ” , “ H e i g h t ” ]