Data Wrangling With Python -- Part 2
We can delete one or more rows from a data frame. With the help of the boolean condition, we can create a new data frame that excludes rows we want to delete. We can also use drop method like df.drop([0,1],axis 0) to drop the first two rows.More practical method is simply to wrap boolean condition inside df[]. If we notice clearly, we didn't drop any rows() The reason is drop_duplicates() defaults only dropping rows that match across all columns. Every row in the data frame is unique.
Mar-4-2021, 13:15:52 GMT
- Technology: