Deleting rows that are duplicated in one column based on the conditions of another column

前端 未结 5 610
我在风中等你
我在风中等你 2020-12-13 13:46

Here is an example of my data set;

Date      Time(GMT)Depth Temp  Salinity Density Phosphate
24/06/2002  1000    1           33.855          0.01
24/06/2002          


        
5条回答
  •  情歌与酒
    2020-12-13 13:52

    Lets say you have data in df

    df = df[order(df[,'Date'],-df[,'Depth']),]
    df = df[!duplicated(df$Date),]
    

提交回复
热议问题