I have a dataframe like this:
name upvotes posts
0 Britt 4 232
1 Henry 1 152
...
9 Kevin 1 48
I want to create a new column, let's call it clout
, that is a function of a user's score and posts.
In standard fare Python, if this was a list of dictionaries, I would approach the problem iteratively as follows:
for row in myListOfDicts:
row['clout'] = computeClout(row['upvotes'],row['posts'])
But this approach seems wrong in Pandas based off of this answer: https://stackoverflow.com/a/55557758/4382391
So what should I be doing in this case?