I want to extract only certain rows from the data frame

Asked 2 years ago, Updated 2 years ago, 49 views

In the data frame, 1, 2, and 3 overlap in the id column, and I want to pull out only the top row.

I want to make it so that the results come out The result will also come out as a data frame,,

python dataframe

2022-09-21 22:03

1 Answers

extracted = YOUR_DF.drop_duplicates(subset=["id"])


2022-09-21 22:03

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.