typo in 59 and changed solution of 66
This commit is contained in:
parent
62bf042b6c
commit
45b87e81d3
@ -1015,7 +1015,7 @@
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"#### 59. How to I sort an array by the nth column? (★★☆)"
|
||||
"#### 59. How to sort an array by the nth column? (★★☆)"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -1243,7 +1243,7 @@
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"#### 59. How to I sort an array by the nth column? (★★☆)"
|
||||
"#### 59. How to sort an array by the nth column? (★★☆)"
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -1423,9 +1423,11 @@
|
||||
"\n",
|
||||
"w,h = 16,16\n",
|
||||
"I = np.random.randint(0,2,(h,w,3)).astype(np.ubyte)\n",
|
||||
"F = I[...,0]*256*256 + I[...,1]*256 +I[...,2]\n",
|
||||
"#Note that we should compute 256*256 first. \n",
|
||||
"#Otherwise numpy will only promote F.dtype to 'uint16' and overfolw will occur\n",
|
||||
"F = I[...,0]*(256*256) + I[...,1]*256 +I[...,2]\n",
|
||||
"n = len(np.unique(F))\n",
|
||||
"print(np.unique(I))"
|
||||
"print(n)"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user