FunctionRacerProblemsRace

One Column per Name

Easyscikit-learnPython

Return colors as a table of 0s and 1s with one column per different color, in alphabetical order: each row has a 1 in the column of its color.

Example 1

colors ["red","green","red","blue"]
returns [[0.0,0.0,1.0],[0.0,1.0,0.0],[0.0,0.0,1.0],[1.0,0.0,0.0]]

The columns are blue, green, red.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More scikit-learn problems