1

Normalization of Data between 0 and 1

Unsolved
Data Wrangling

Difficulty: 2 | Problem written by Mr. Umair
Problem reported in interviews at

Apple
Google

When performing statistical analyses, data should be in a normalized form. Normalization is used to fit the data within unity so that all values must fall in range between 0 and 1. There are different kinds of normalization but here we will use Min-Max Normalization, which is:

\(X=(X-min(X))/(max(X)-min(X))\)

 

Input Details:

NumPy array of random floating point values.

Output Details:

A NumPy array with data in normalized form ranging from 0 to 1.

Sample Input:
<class 'numpy.ndarray'>
inputArray: [30 40 70]

Expected Output:
<class 'numpy.ndarray'>
[0. 0.25 1. ]

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Quae dolorum distinctio nobis vitae possimus veniam quaerat, deserunt illum omnis dolores ex tempore, ut temporibus consequatur explicabo minima praesentium in?

Perferendis reprehenderit maiores similique repellendus natus eius dignissimos nam maxime. Tempore natus vero eligendi, quo eos officiis atque neque rem consectetur nam sit ut libero, quod molestiae ipsa recusandae, molestias dolores quo distinctio vel omnis blanditiis?

Nisi eligendi repellat reprehenderit vel libero, incidunt doloribus assumenda libero ullam molestias ipsa dolores eum harum, quod culpa in unde quibusdam repellat eius vitae non quisquam deserunt, ullam atque reprehenderit nam unde itaque, ex quos dolorum eligendi pariatur quas voluptatem ad unde?

This is a premium feature.
To access this and other such features, click on upgrade below.

Ready.

Input Test Case

Please enter only one test case at a time
numpy has been already imported as np (import numpy as np)