Answers for "pandas select unique rows"

4

dataframe unique values in each column

for col in df:
    print(df[col].unique())
Posted by: Guest on August-20-2020
0

distinct rows in this DataFrame

# distinct rows in this DataFrame

df.distinct().count()
# 2
Posted by: Guest on April-20-2020
0

get unique words from pandas dataframe

results = set()
df['text'].str.lower().str.split().apply(results.update)

$ set(['someone', 'ft.jgt', 'my', 'is', 'to', 'going', 'place', 'nickname'])
Posted by: Guest on November-25-2020

Python Answers by Framework

Browse Popular Code Answers by Language