From the course: Advanced Hands-On Python: Working with Excel and Spreadsheet Data

Unlock the full course today

Join today to access over 24,600 courses taught by industry experts.

Working with content

Working with content

- [Instructor] In this example, we're going to look at some different ways to access the content within a worksheet. So let's open the example file workbook_content. And you can see I already have some code that loads the FinancialSample Excel file that we've been using. And it gets the first worksheet. We've seen some simple examples of how to access worksheet content already, and I'll expand on those methods here. So first, let's take a look at how to get access to a range of cells. You can get an entire column or row of cells by using either a letter or numeric index respectively. So to get all the cells in column C or all the cells in row 10, I would write some code like this. I can col sheet and just pass in the letter C for the entire column, or I can get an entire row by using a numerical index. And then once we've done that, let's just print out some information about that column and row. So we'll print out the length of column, cells in the column, and then let's do the same…

Contents