I have a dataframe with 3 columns.
The first column being numerical and is named 'stake'.
The second column is named 'returns' and is also numerical.
The third column is text and can be either 'Win' or 'Lose'
I am looking to add a fourth column that prints the row figure from column 2 if column 3 says 'Win' - and print -Column 1 if column 3 says 'Lose'.
I apologise for the quality of this question - i am unsure how to write data in the form of a table in a question! Hopefully you guys unstand what I'm asking :)
Aucun commentaire:
Enregistrer un commentaire