Skip to content

Practice Modify Columns

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Easy#2884
LeetCode Problem

Modify Columns

Problem Statement

The employees DataFrame has name (object) and salary (int) columns. Multiply every salary by 2 in the salary column and return the resulting DataFrame.

Source: Modify Columns on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
DataFrame employees +---------+--------+ | name    | salary | +---------+--------+ | Jack    | 19666  | | Piper   | 74754  | | Mia     | 62509  | | Ulysses | 54866  | +---------+--------+
Output
+---------+--------+ | name    | salary | +---------+--------+ | Jack    | 39332  | | Piper   | 149508 | | Mia     | 125018 | | Ulysses | 109732 | +---------+--------+

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.