Skip to content
CampusEduX

Problem 2: Apply Normalization to a Dataset

Easypython
Learn the Concept: Feature Scaling

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().

Related Problems

  • Problem 1: Apply Standardization to a Dataset
    Easy · python
    Solve Problem
  • Problem 3: Correctly Scale Training and Test Sets Separately
    Easy · python
    Solve Problem
  • Problem 4: Compare Standardization vs Normalization on the Same Data
    Easy · python
    Solve Problem

Input (stdin)

Output

Run your code to see output here...