How do I modify a coumn value in Pandas where new values are two times the previous values?
I tried this:
employees.loc[‘salary’] = employees[‘salary’]*2
Input:
DataFrame employees
+———+——–+
| name | salary |
+———+——–+
| Jack | 19666 |
| Piper | 74754 |
| Mia | 62509 |
| Ulysses | 54866 |
Output:
| name | salary |
+———+——–+
| Jack | 39332 |
| Piper | 149508 |
| Mia | 125018 |
| Ulysses | 109732 |
New contributor
Swapnil Kumar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.