Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.5k views
in Technique[技术] by (71.8m points)

python - compare column values in a df

data = [
['30', '12', '42','mango'],
['30','30','100','apple'],
['10', '70','300','logo'],
['10','200','700','visiblelogo'],
['20','800','900','banana'],
['20','600','1000','fruit'],
['40','600','1200','visiblelogo'],
['40','1100','1300','logo'],
['90','2010','2100','orange']
]

df= pd.DataFrame(data, columns=['unique_id', 'start_frame', 
'end_frame','heading'])
    print(df)

Comparing start_frame values should be greater than previous row end_frame value. Else pick index and display. Omit when heading==logo or visible_logo. Desired `output =[30,20]


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...