Filtering dataframe for unique rows with respect one of column

Hello i have following DataFrame :

julia> a = DataFrame(x = [1, 2, 2, 3, 4], b = [3, 4, 5, 6, 7])
5×2 DataFrame
 Row │ x      b     
     │ Int64  Int64 
─────┼──────────────
   1 │     1      3
   2 │     2      4
   3 │     2      5
   4 │     3      6
   5 │     4      7

Now what I want is this : Im not sure how to do such filtering. Initially I thought unique() will help but then both rows are not identical so it doesn’t detect it.

4×2 DataFrame
 Row │ x      b     
     │ Int64  Int64 
─────┼──────────────
   1 │     1      3
   2 │     2      4
   3 │     3      6
   4 │     4      7

Thank you :slight_smile:

You mean this?

julia> unique(a, :x)
4×2 DataFrame
 Row │ x      b
     │ Int64  Int64
─────┼──────────────
   1 │     1      3
   2 │     2      4
   3 │     3      6
   4 │     4      7
2 Likes