single line pre for data analysis with python
This commit is contained in:
@ -35,21 +35,25 @@ print(s.notnull().sum())
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<pre>0 True
|
<pre>
|
||||||
|
0 True
|
||||||
1 True
|
1 True
|
||||||
2 False
|
2 False
|
||||||
3 True
|
3 True
|
||||||
4 False
|
4 False
|
||||||
dtype: bool</pre>
|
dtype: bool
|
||||||
|
</pre>
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<pre>0 False
|
<pre>
|
||||||
|
0 False
|
||||||
1 False
|
1 False
|
||||||
2 True
|
2 True
|
||||||
3 False
|
3 False
|
||||||
4 True
|
4 True
|
||||||
dtype: bool</pre>
|
dtype: bool
|
||||||
|
</pre>
|
||||||
|
|
||||||
## --video-solution--
|
## --video-solution--
|
||||||
|
|
||||||
|
@ -28,27 +28,19 @@ print(a <= 3)
|
|||||||
|
|
||||||
## --answers--
|
## --answers--
|
||||||
|
|
||||||
```python
|
<pre>[False, False, False, False, True]</pre>
|
||||||
[False, False, False, False, True]
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
```python
|
<pre>[5]</pre>
|
||||||
[5]
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
```python
|
<pre>[0, 1, 2, 3]</pre>
|
||||||
[0, 1, 2, 3]
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
```python
|
<pre>[True, True, True, True, False]</pre>
|
||||||
[True, True, True, True, False]
|
|
||||||
```
|
|
||||||
|
|
||||||
## --video-solution--
|
## --video-solution--
|
||||||
|
|
||||||
|
@ -27,21 +27,15 @@ a + 20
|
|||||||
|
|
||||||
## --answers--
|
## --answers--
|
||||||
|
|
||||||
```python
|
<pre>[20, 21, 22, 24, 24]</pre>
|
||||||
[20, 21, 22, 24, 24]
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
```python
|
<pre>[0, 1, 2, 3, 4]</pre>
|
||||||
[0, 1, 2, 3, 4]
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
```python
|
<pre>[25, 26, 27, 28, 29]</pre>
|
||||||
[25, 26, 27, 28, 29]
|
|
||||||
```
|
|
||||||
|
|
||||||
## --video-solution--
|
## --video-solution--
|
||||||
|
|
||||||
|
@ -20,11 +20,13 @@ More resources:
|
|||||||
|
|
||||||
What code would add a "Certificates per month" column to the `certificates_earned` DataFrame like the one below?
|
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
|
Tom 8 16 0.50
|
||||||
Kris 2 5 0.40
|
Kris 2 5 0.40
|
||||||
Ahmad 5 9 0.56
|
Ahmad 5 9 0.56
|
||||||
Beau 6 12 0.50</pre>
|
Beau 6 12 0.50
|
||||||
|
</pre>
|
||||||
|
|
||||||
## --answers--
|
## --answers--
|
||||||
|
|
||||||
|
@ -33,33 +33,33 @@ print(certificates_earned)
|
|||||||
|
|
||||||
## --answers--
|
## --answers--
|
||||||
|
|
||||||
```
|
<pre>
|
||||||
Tom 8
|
Tom 8
|
||||||
Kris 2
|
Kris 2
|
||||||
Ahmad 5
|
Ahmad 5
|
||||||
Beau 6
|
Beau 6
|
||||||
dtype: int64
|
dtype: int64
|
||||||
```
|
</pre>
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
```
|
<pre>
|
||||||
Kris 2
|
Kris 2
|
||||||
Ahmad 5
|
Ahmad 5
|
||||||
Beau 6
|
Beau 6
|
||||||
Tom 8
|
Tom 8
|
||||||
dtype: int64
|
dtype: int64
|
||||||
```
|
</pre>
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
```
|
<pre>
|
||||||
Tom 8
|
Tom 8
|
||||||
Kris 2
|
Kris 2
|
||||||
Ahmad 5
|
Ahmad 5
|
||||||
Beau 6
|
Beau 6
|
||||||
Name: certificates_earned dtype: int64
|
Name: certificates_earned dtype: int64
|
||||||
```
|
</pre>
|
||||||
|
|
||||||
## --video-solution--
|
## --video-solution--
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user