To Delete rows and columns from the data frames, we use drop method in pandas package.
1. Name of the columns are used and specify the axis=1 to delete single or multiple columns
2. The list of index labels can be passed to the drop method to delete the rows.
Example:
Original data frame:
Data frame after dropping columns:
Data frame after dropping rows:
No comments:
Post a Comment