Skip to content
C

Problem 2: Apply Normalization to a Dataset

Easypython

Problem Description

Write a Python program that applies MinMaxScaler to a DataFrame with two numeric columns, and prints the scaled result, confirming all values fall between 0 and 1.

Input

A DataFrame with two numeric columns.

Output

The normalized DataFrame (values between 0 and 1).

Constraints

  • Columns will contain at least 3 numeric values each.

Example Input

text
{"age": [20, 30, 40], "salary": [30000, 50000, 70000]}

Example Output

text
age salary 0 0.0 0.0 1 0.5 0.5 2 1.0 1.0

Concepts Covered

MinMaxScaler, fit_transform().

Input (stdin)

Output

Run your code to see output here...