Zero to One
Return X with every column rescaled so that its smallest value becomes 0 and its largest becomes 1.
Example 1
X [[1,100],[2,200],[5,300]]
returns [[0.0,0.0],[0.25,0.5],[1.0,1.0]]
2 is a quarter of the way from 1 to 5, and 200 is halfway from 100 to 300.
Constraints
- 2 to 30 rows, 1 to 4 columns
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.