How to Access Rows by Name in Pandas (Python)

preview_player
Показать описание
↓ Code Available Below! ↓

This video shows how to access specific rows of a pandas data frame using the index names of the rows. Data frames don't always have text row names assigned to the columns, but when they do, they can be used to access specific rows instead of using numeric indexing.

If you find this video useful, like, share and subscribe to support the channel!

Code used in this Python Code Clip:

import pandas as pd

# Access a row by by name with .loc

# Access multiple rows by by name

# Access multiple rows and specific columns by name

* Note: YouTube does not allow greater than or less than symbols in the text description, so the code above will not be exactly the same as the code shown in the video! I will use Unicode large < and > symbols in place of the standard sized ones. .

Рекомендации по теме
Комментарии
Автор

What is the 1st col name and what is the set name? Doesn’t work if the vid does not especify the header of the “sm”

lǎozǐ-thefirstofhisname