Same Scale
The columns of X are measured in very different units. Return X with every column standardized: shifted to mean 0 and scaled to standard deviation 1.
Example 1
X [[1,100],[2,200],[3,300]]
returns [[-1.224744871391589,-1.224744871391589],[0.0,0.0],[1.224744871391589,1.224744871391589]]
Both columns become -1.22, 0, 1.22: once standardized they are the same.
Example 2
X [[0,5],[10,5]]
returns [[-1.0,0.0],[1.0,0.0]]
A column that never changes becomes all zeros.
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.
More scikit-learn problems
- Share RightBeginner
- Typical Squared MissBeginner
- What the Model LearnedBeginner
- Zero to OneBeginner
- Curves From LinesEasy
- Fill the HolesEasy
- Found and FlaggedEasy
- One Column per NameEasy