0

I want to edit a row in in my dataframe such as:

index columnA ColumnB
0     1       [a, b]
1     3       [c, b]
2     4       [a, b]
3     6       [d, a, b]

Lets say I want to replace the [c, b] with [q, y] where the columnA is value 3. How would I go about doing that. I tried the following:

df.at[df['columnA'] == 3, 'ColumnB'] = [q, y]

Both are columns and I would like to edit the row based on the columnA value and not the index.

Bada
  • 100
  • 11

0 Answers0