You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Summary
An important part of data exploration is the retrieval and interrogation of uniqueness of values within column(s) as well as counts.
In SQL, this is achieved with:
SELECT DISTINCT x, y, z FROM ...
- retrieves distinct tuples of (x, y, z)SELECT x, y, z, COUNT(*) GROUP BY x, y, z
- retrieves distinct tuples of (x, y, z) and counts of their occurrencesSELECT COUNT(DISTINCT x), COUNT(DISTINCT y), COUNT(DISTINCT z)
- retrieves counts of distinct occurrences of x, y, and zIn other DataFrames such as Pandas, there are dedicated methods such as:
df.drop_duplicates
df.groupby(x, y, z).size()
df.value_counts
Proposal
Work Breakdown
Concretely, the work needed to achieve the above is:
.distinct()
to take in columns as argumentsBeta Was this translation helpful? Give feedback.
All reactions