Alright now you know how to extract portion of a data frame.
But how about deleting columns or rows from a data frame.
Well for that you do want to use the df7.drop. So the Drop Method.
Note that this is also not an inplace operation.
So your df7 data frame will not be updated
with the deleted column. And yeah, let me delete the City column. You'd pass city for the column name and then 1.
So the 1 argument means that you are about to delete columns. That's how you tell Pandas or Python
what you're about to delete. When you delete throws you want to pass zero.
So yeah this is the on the fly data frame without the city column there.
So again df7 with City and drop.
Let me drop 332 Hill St zero. And yeah, Hill Street is not there.
And of course if you want to update your data frame with the changes you do that and then when you print out
your df7 data frame the Hill Street is not there.
Yeah if you want to drop columns or rows based on indexing you do a trick like df7 and then points
to index.
And than what do you want.
Well zero to three maybe.
So you are deleting rows. Execute that and you get the 3 rows only.
Similarly with columns. Columns and one in here.
So you get ID name and state.
The first three columns.
So if that confused you know df7.index what that gives you is a series with the names
or with the labels of your index column.
So all of these and similarly Columns gives you the names all of your columns.
So that's how you access the header of your data frame and the index column.
And yeah, that was about deleting columns and rows from the data frame.
If you have questions just feel free to ask them.
I'll talk to you to the next lecture.