As the question says, I have a data frame df_original
which is quite large but looks like:
ID Count Column 2 Column 3 Column 4
RowX 1 234. 255. yes. 452
RowY 1 123. 135. no. 342
RowW 1 234. 235. yes. 645
RowJ 1 123. 115. no. 342
RowA 1 234. 285. yes. 233
RowR 1 123. 165. no. 342
RowX 2 234. 255. yes. 234
RowY 2 123. 135. yes. 342
RowW 2 234. 235. yes. 233
RowJ 2 123. 115. yes. 342
RowA 2 234. 285. yes. 312
RowR 2 123. 165. no. 342
.
.
.
RowX 1233 234. 255. yes. 133
RowY 1233 123. 135. no. 342
RowW 1233 234. 235. no. 253
RowJ 1233 123. 115. yes. 342
RowA 1233 234. 285. yes. 645
RowR 1233 123. 165. no. 342
I am trying to get rid of the text data and replace it with a predefined numerical equivalent. For example, in this case, I'd like to replace Column3
's yes
or no
values with 1
or 0
respectively. Is there a way to do this without me having to manually go in and alter the values?