Skip to content
Advertisement

How to replace multiple column values for specific row in python dataframe?

I have dataframe with thousand columns, I want to replace a few columns (which I stored in a dictionary) for a specific row, how can I do that?

JavaScript

If you have another method to do without considering the dictionary then please suggest me, I will twerk my code accordingly. I just want to complete this operation.

Advertisement

Answer

Say you have this input data:

JavaScript

Then you can do:

JavaScript

df output:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement