All problems

Log-Transforming Skewed Features

easyPythonFeature Engineering

Quillon Energy's annual-bill column is badly lopsided. Most households cluster in the low hundreds while a handful of industrial sites run to six figures, so the column has a long tail off to the right and almost every model treats those few sites as the only rows worth listening to. The standard remedy is to restate each bill by its scale rather than its size, which pulls the tail in and spreads the crowded low end out. The team wants the natural logarithm -- the one to base e, not base 10 and not base 2 -- and the bill itself, with nothing added to it first.

Task: Print each bill restated on the logarithmic scale.

Input

The first line holds one integer n, the number of bills. The second line holds the n bills separated by single spaces. Every bill is greater than zero.

Output

n lines, one per bill, in the order the bills arrived. Each holds the restated value rounded to 4 decimal places.

Example:

Input:
3
1 10 100

Output:
0.0000
2.3026
4.6052

Sign in to solve this problem

Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.

Sign in

Discussion

Sign in to join the discussion — reading is open to everyone.

Loading comments…