How to Remove Duplicate Rows From a Data Frame in Pandas (Python)

preview_player
Показать описание
↓ Code Available Below! ↓

If you find this video useful, like, share and subscribe to support the channel!

Code used in this Python Code Clip:

import pandas as pd

data = pd.DataFrame({"character": ["Goku","Vegeta", "Nappa","Goku","Piccolo"],
"power level": [12000, 16000, 4000, 12000, 3000]})

data

data

** Note: YouTube does not allow greater than or less than symbols in the text description, so the code above will not be exactly the same as the code shown in the video! I will use Unicode large < and > symbols in place of the standard sized ones. .

Рекомендации по теме
Комментарии
Автор

import pandas as pd

data = pd.DataFrame({"character": ["Goku", "Vegeta", "Nappa", "Goku", "Piccolo"],
"power level": [12000, 16000, 4000, 12000, 3000]})

data

# Use df.drop_duplicates() to remove duplicate rows
data = data.drop_duplicates()

data

DataDaft
Автор

i love the characters you used got the thumbs up from me

benjaminshamash
Автор

quick, easy and effective - great video

MS-qkcz