single line pre for data analysis with python

pull/40603/head
ieahleen 2021-01-01 18:40:00 +00:00
parent 03a5379062
commit 3bccaff753
5 changed files with 25 additions and 33 deletions

View File

@ -35,21 +35,25 @@ print(s.notnull().sum())
---
<pre>0 True
<pre>
0 True
1 True
2 False
3 True
4 False
dtype: bool</pre>
dtype: bool
</pre>
---
<pre>0 False
<pre>
0 False
1 False
2 True
3 False
4 True
dtype: bool</pre>
dtype: bool
</pre>
## --video-solution--

View File

@ -28,27 +28,19 @@ print(a <= 3)
## --answers--
```python
[False, False, False, False, True]
```
<pre>[False, False, False, False, True]</pre>
---
```python
[5]
```
<pre>[5]</pre>
---
```python
[0, 1, 2, 3]
```
<pre>[0, 1, 2, 3]</pre>
---
```python
[True, True, True, True, False]
```
<pre>[True, True, True, True, False]</pre>
## --video-solution--

View File

@ -27,21 +27,15 @@ a + 20
## --answers--
```python
[20, 21, 22, 24, 24]
```
<pre>[20, 21, 22, 24, 24]</pre>
---
```python
[0, 1, 2, 3, 4]
```
<pre>[0, 1, 2, 3, 4]</pre>
---
```python
[25, 26, 27, 28, 29]
```
<pre>[25, 26, 27, 28, 29]</pre>
## --video-solution--

View File

@ -20,11 +20,13 @@ More resources:
What code would add a "Certificates per month" column to the `certificates_earned` DataFrame like the one below?
<pre> Certificates Time (in months) Certificates per month
<pre>
Certificates Time (in months) Certificates per month
Tom 8 16 0.50
Kris 2 5 0.40
Ahmad 5 9 0.56
Beau 6 12 0.50</pre>
Beau 6 12 0.50
</pre>
## --answers--

View File

@ -33,33 +33,33 @@ print(certificates_earned)
## --answers--
```
<pre>
Tom 8
Kris 2
Ahmad 5
Beau 6
dtype: int64
```
</pre>
---
```
<pre>
Kris 2
Ahmad 5
Beau 6
Tom 8
dtype: int64
```
</pre>
---
```
<pre>
Tom 8
Kris 2
Ahmad 5
Beau 6
Name: certificates_earned dtype: int64
```
</pre>
## --video-solution--