2020-04-21 12:42:19 -04:00
|
|
|
---
|
|
|
|
id: 5e9a0a8e09c5df3cc3600ed9
|
|
|
|
title: Reorganizing Arrays
|
|
|
|
challengeType: 11
|
|
|
|
videoId: VNWAQbEM-C8
|
|
|
|
---
|
|
|
|
|
|
|
|
## Description
|
2020-08-04 20:56:41 +01:00
|
|
|
|
2020-04-21 12:42:19 -04:00
|
|
|
<section id='description'>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
## Tests
|
2020-08-04 20:56:41 +01:00
|
|
|
|
2020-04-21 12:42:19 -04:00
|
|
|
<section id='tests'>
|
|
|
|
|
2020-08-04 20:56:41 +01:00
|
|
|
````yml
|
2020-04-21 12:42:19 -04:00
|
|
|
question:
|
2020-05-28 22:40:36 +09:00
|
|
|
text: |
|
2020-08-04 20:56:41 +01:00
|
|
|
What code would produce the following array?
|
2020-05-28 22:40:36 +09:00
|
|
|
|
2020-08-04 20:56:41 +01:00
|
|
|
```py
|
2020-05-28 22:40:36 +09:00
|
|
|
[[1. 1.]
|
|
|
|
[1. 1.]
|
|
|
|
[1. 1.]
|
|
|
|
[1. 1.]]
|
|
|
|
```
|
2020-04-21 12:42:19 -04:00
|
|
|
answers:
|
2020-05-28 22:40:36 +09:00
|
|
|
- |
|
|
|
|
```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)
|
|
|
|
```
|
|
|
|
solution: 1
|
2020-08-04 20:56:41 +01:00
|
|
|
````
|
2020-04-21 12:42:19 -04:00
|
|
|
|
|
|
|
</section>
|