Write a pandas program to filter out rows based on different criteria such as duplicate rows.
Program Description:
This program selects duplicate rows from data frame on the basis of column name.
Program Logic:
- Create dictionary say ‘Sales_data’ which contain detail information about product such as item category,item name,expenditure.
- Create DataFrame say ‘df’ using DataFrame method of pandas module and pass dictionary ‘Sales_data as an argument to DataFrame ‘df’
- Use duplicated method of DataFrame to display all duplicate rows from DataFrame ‘df’
- Apply duplicated method of DataFrame on column ‘Item_name‘ to display redundant rows on the basis of item name
- Apply duplicated method of DataFrame on column ‘Expenditure’ to display duplicate rows on the basis of expenditure.
- Display all result on console using print function
- Exit
Below is implementation code/Source code


Output:


<