Skip to content
C

Problem 3: Generate Polynomial Features

Easypython

Problem Description

Write a Python program that generates polynomial features (degree 2) for a single numeric column using PolynomialFeatures.

Input

A list of numeric values representing a single feature.

Output

The generated polynomial features (original value and its square).

Constraints

  • At least 4 values.

Example Input

text
[10, 20, 30, 40]

Example Output

text
[[ 10. 100.] [ 20. 400.] [ 30. 900.] [ 40.1600.]]

Concepts Covered

PolynomialFeatures, degree=2.

Input (stdin)

Output

Run your code to see output here...