Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.4k 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 Reply

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...