multiline pre in numpy questions

This commit is contained in:
ieahleen
2021-01-01 18:38:16 +00:00
parent 62fb990439
commit af1a02cdd3
5 changed files with 20 additions and 20 deletions

View File

@ -18,25 +18,25 @@ print(b)
## --answers--
```python
<pre>
[[1.0 2.0 3.0]
[3.0 4.0 5.0]]
```
</pre>
---
```python
<pre>
[[1. 2. 3.]
[3. 4. 5.]]
```
</pre>
---
```python
<pre>
[[1. 3.]
[2. 4.]
[3. 5.]
```
</pre>
## --video-solution--

View File

@ -11,7 +11,7 @@ videoId: 0jGfH8BPfOk
What is another way to produce the following array?
```py
<pre>
[[0. 0. 0. 0. 0. 0. 0.]
[0. 1. 1. 1. 1. 1. 0.]
[0. 1. 1. 1. 1. 1. 0.]
@ -19,7 +19,7 @@ What is another way to produce the following array?
[0. 1. 1. 1. 1. 1. 0.]
[0. 1. 1. 1. 1. 1. 0.]
[0. 0. 0. 0. 0. 0. 0.]]
```
</pre>
## --answers--

View File

@ -19,23 +19,23 @@ print(np.full_like(a, 100))
## --answers--
```py
<pre>
[[100 100 100 100 100]]
```
</pre>
---
```py
<pre>
[[100 100 100 100 100]
[100 100 100 100 100]]
```
</pre>
---
```py
<pre>
[[ 1 2 3 4 5]
[ 6 7 20 9 10]]
```
</pre>
## --video-solution--

View File

@ -11,16 +11,16 @@ videoId: tUdBZ7pF8Jg
Given a file named `data.txt` with these contents:
```
<pre>
29,97,32,100,45
15,88,5,75,22
```
</pre>
What code would produce the following array?
```py
<pre>
[29. 32. 45. 15. 5. 22.]
```
</pre>
## --answers--

View File

@ -11,12 +11,12 @@ videoId: VNWAQbEM-C8
What code would produce the following array?
```py
<pre>
[[1. 1.]
[1. 1.]
[1. 1.]
[1. 1.]]
```
</pre>
## --answers--