Good job! We can also delete the rows or columns by using the
delete_columns methods. Suppose we have a small worksheet, like the one you saw in the previous part:
The index of the row with the column names is
0. If we wanted to delete the row that contains all the data about Mary Sue, we would write:
2 signifies the row index. We could also add a second argument that would indicate the number of rows we want to delete, including the row given as the first argument. Here's an example:
This removes three consecutive rows starting with the second one. We can do the same thing with columns. However, you must pass that column's index number, not the column's letter:
The code above deletes the column with the index
"C"); in this case, that's information about the position of each employee.