Setting column to true/false based on comparison of two other columns in pandas?
--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Hypnotic Puzzle3
--
Chapters
00:00 Setting Column To True/False Based On Comparison Of Two Other Columns In Pandas?
00:45 Accepted Answer Score 6
00:57 Thank you
--
Full question
https://stackoverflow.com/questions/6448...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#python #pandas
#avk47
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Hypnotic Puzzle3
--
Chapters
00:00 Setting Column To True/False Based On Comparison Of Two Other Columns In Pandas?
00:45 Accepted Answer Score 6
00:57 Thank you
--
Full question
https://stackoverflow.com/questions/6448...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#python #pandas
#avk47
ACCEPTED ANSWER
Score 6
Basically, below line will check each row and boolean result will be assigned into the new column of provided as:
df['provided'] = df['value'] == df['predicted']