Move from Excel to Python with Pandas Transcripts
Chapter: Intro to Pandas
Lecture: Concept: Selecting rows and columns
0:00 Here's a reference you can use to refer back to to make sure you understand how
0:03 to use loc and iloc.
0:05 The first thing to keep in mind is that it's always rows then columns,
0:08 and when you want to select a row,
0:10 you can use a colon to select all the rows.
0:12 You can also provide a list,
0:14 or you can slice the rows,
0:15 and you could do a similar thing.
0:17 From a column perspective, you can select all the columns,
0:20 a list of columns or slice the columns I loc is similar,
0:25 but you can use indexes instead so you can select all rows or a subset of
0:30 rows. But when you select your columns,
0:32 you can use a numerical value in future.
0:34 Sections will talk about Boolean indexing using these same formats,
0:39 and it's really powerful way and the way that I normally will sub select the data in my data frames