79833251

Date: 2025-11-29 12:49:48
Score: 1
Natty:
Report link

Use applymap:

df[['Age', 'Salary']] = df[['Age', 'Salary']].applymap(lambda x: x + 100 if x > 30 else 0)

It does exactly what your single-column apply does, but works for multiple columns in one line.

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Ammar sadek