<jupyter_start><jupyter_text>Data Preparation Basics Segment 3 - Removing duplicates<jupyter_code>import numpy as np
import pandas as pd

from pandas import Series, DataFrame<jupyter_output><empty_output><jupyter_text>Removing duplicates<jupyter_code>DF_obj= DataFrame({'column 1':[1,1,2,2,3,3,3],
                   'column 2':['a', 'a','b', 'b', 'c', 'c', 'c'],
                   'column 3':['A', 'A', 'B', 'B', 'C', 'C', 'C']})
DF_obj
DF_obj.duplicated()
DF_obj.drop_duplicates()
DF_obj= DataFrame({'column 1':[1,1,2,2,3,3,3],
                   'column 2':['a', 'a','b', 'b', 'c', 'c', 'c'],
                   'column 3':['A', 'A', 'B', 'B', 'C', 'D', 'C']})
DF_obj<jupyter_output><empty_output><jupyter_text><jupyter_code>DF_obj.drop_duplicates(['column 3'])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.22264150943396227, 'fraction_numerical': 0.027672955974842768, 'mean_word_length': 4.605633802816901, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '527774', 'license': 'MIT', 'n_tokens_mistral': 342, 'n_tokens_neox': 321, 'n_words': 60, 'path': '1 Data Preparation Basics/3 Removing Duplicates.ipynb', 'repo_name': 'RhishabMukherjee/CheatSheet', 'size': '795'}