| 
									
										
										
										
											2021-05-05 10:13:49 -07:00
										 |  |  | --- | 
					
						
							|  |  |  | id: 5e9a0a8e09c5df3cc3600ed9 | 
					
						
							| 
									
										
										
										
											2021-07-16 11:03:16 +05:30
										 |  |  | title: 重組數組 | 
					
						
							| 
									
										
										
										
											2021-05-05 10:13:49 -07:00
										 |  |  | challengeType: 11 | 
					
						
							|  |  |  | videoId: VNWAQbEM-C8 | 
					
						
							| 
									
										
										
										
											2021-10-03 12:24:27 -07:00
										 |  |  | bilibiliIds: | 
					
						
							|  |  |  |   aid: 548035655 | 
					
						
							|  |  |  |   bvid: BV1fq4y1N7aC | 
					
						
							|  |  |  |   cid: 409026755 | 
					
						
							| 
									
										
										
										
											2021-05-05 10:13:49 -07:00
										 |  |  | dashedName: reorganizing-arrays | 
					
						
							|  |  |  | --- | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # --question--
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ## --text--
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-16 11:03:16 +05:30
										 |  |  | 哪個代碼會生成下面的數組? | 
					
						
							| 
									
										
										
										
											2021-05-05 10:13:49 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | ```py | 
					
						
							|  |  |  | [[1. 1.] | 
					
						
							|  |  |  | [1. 1.] | 
					
						
							|  |  |  | [1. 1.] | 
					
						
							|  |  |  | [1. 1.]] | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ## --answers--
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ```py | 
					
						
							|  |  |  | a = np.ones((2, 4)) | 
					
						
							|  |  |  | b = a.reshape((4, 2)) | 
					
						
							|  |  |  | print(b) | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | --- | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ```py | 
					
						
							|  |  |  | a = np.ones((2, 4)) | 
					
						
							|  |  |  | b = a.reshape((2, 4)) | 
					
						
							|  |  |  | print(b) | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | --- | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ```py | 
					
						
							|  |  |  | a = np.ones((2, 4)) | 
					
						
							|  |  |  | b = a.reshape((8, 1)) | 
					
						
							|  |  |  | print(b) | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ## --video-solution--
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 1 | 
					
						
							|  |  |  | 
 |