Adding language to code fences and pre to console logs (#40603)
* added languages to prismjs * added language to code fences for python for everybody * multiline pre to python for everybody questions * multiline pre for data analysis with python * multiline pre in numpy questions * single line pre for python for everybody * single line pre for data analysis with python * single line pre for numpy * Revert "multiline pre in numpy questions" This reverts commitaf1a02cdd3
. * fix unneded escaping commit suggestions from code review Co-authored-by: Shaun Hamilton <51722130+ShaunSHamilton@users.noreply.github.com> * Revert "single line pre for numpy" This reverts commit5f90981108
. * revert changes to snippet that have a language * one last code fence to pre * Revert "fix unneded escaping " This reverts commit64c84a9213
. * Revert "single line pre for data analysis with python" This reverts commit3bccaff753
. * Revert "single line pre for python for everybody" This reverts commit03a5379062
. * remove unnecessary escape Co-authored-by: Shaun Hamilton <51722130+ShaunSHamilton@users.noreply.github.com>
This commit is contained in:
@ -36,25 +36,21 @@ print(s.notnull().sum())
|
||||
|
||||
---
|
||||
|
||||
```
|
||||
0 True
|
||||
<pre>0 True
|
||||
1 True
|
||||
2 False
|
||||
3 True
|
||||
4 False
|
||||
dtype: bool
|
||||
```
|
||||
dtype: bool</pre>
|
||||
|
||||
---
|
||||
|
||||
```
|
||||
0 False
|
||||
<pre>0 False
|
||||
1 False
|
||||
2 True
|
||||
3 False
|
||||
4 True
|
||||
dtype: bool
|
||||
```
|
||||
dtype: bool</pre>
|
||||
|
||||
## --video-solution--
|
||||
|
||||
|
@ -33,36 +33,36 @@ print(s)
|
||||
|
||||
## --answers--
|
||||
|
||||
```
|
||||
<pre>
|
||||
0 1.0
|
||||
1 1.0
|
||||
2 2.0
|
||||
3 3.0
|
||||
4 3.0
|
||||
dtype: float64
|
||||
```
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
```
|
||||
<pre>
|
||||
0 NaN
|
||||
1 1.0
|
||||
2 2.0
|
||||
3 2.0
|
||||
4 3.0
|
||||
dtype: float64
|
||||
```
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
```
|
||||
<pre>
|
||||
0 NaN
|
||||
1 1.0
|
||||
2 2.0
|
||||
3 NaN
|
||||
4 3.0
|
||||
dtype: float64
|
||||
```
|
||||
</pre>
|
||||
|
||||
## --video-solution--
|
||||
|
||||
|
@ -33,7 +33,7 @@ print(A[:, :2])
|
||||
|
||||
## --answers--
|
||||
|
||||
```python
|
||||
```py
|
||||
[['a' 'b']]
|
||||
```
|
||||
|
||||
|
@ -39,33 +39,33 @@ print(certificates_earned)
|
||||
|
||||
## --answers--
|
||||
|
||||
```
|
||||
<pre>
|
||||
Tom 13
|
||||
Kris 11
|
||||
Ahmad 9
|
||||
Beau 7
|
||||
Name: Longest streak, dtype: int64
|
||||
```
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
```
|
||||
<pre>
|
||||
Certificates Time (in months) Longest streak
|
||||
Tom 8 16 13
|
||||
Kris 2 5 11
|
||||
Ahmad 5 9 9
|
||||
Beau 6 12 7
|
||||
```
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
```
|
||||
<pre>
|
||||
Certificates Longest streak
|
||||
Tom 8 13
|
||||
Kris 2 11
|
||||
Ahmad 5 9
|
||||
Beau 6 7
|
||||
```
|
||||
</pre>
|
||||
|
||||
## --video-solution--
|
||||
|
||||
|
@ -21,13 +21,11 @@ More resources:
|
||||
|
||||
What code would add a "Certificates per month" column to the `certificates_earned` DataFrame like the one below?
|
||||
|
||||
```
|
||||
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
|
||||
```
|
||||
Beau 6 12 0.50</pre>
|
||||
|
||||
## --answers--
|
||||
|
||||
|
@ -36,29 +36,29 @@ print(certificates_earned.iloc[2])
|
||||
|
||||
## --answers--
|
||||
|
||||
```
|
||||
<pre>
|
||||
Tom 16
|
||||
Kris 5
|
||||
Ahmad 9
|
||||
Beau 12
|
||||
Name: Time (in months), dtype: int64
|
||||
```
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
```
|
||||
<pre>
|
||||
Certificates 6
|
||||
Time (in months) 12
|
||||
Name: Beau, dtype: int64
|
||||
```
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
```
|
||||
<pre>
|
||||
Certificates 5
|
||||
Time (in months) 9
|
||||
Name: Ahmad, dtype: int64
|
||||
```
|
||||
</pre>
|
||||
|
||||
## --video-solution--
|
||||
|
||||
|
@ -34,30 +34,30 @@ print(certificates_earned[certificates_earned > 5])
|
||||
|
||||
## --answers--
|
||||
|
||||
```
|
||||
<pre>
|
||||
Tom True
|
||||
Kris False
|
||||
Ahmad False
|
||||
Beau True
|
||||
dtype: int64
|
||||
```
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
```
|
||||
<pre>
|
||||
Tom 8
|
||||
Ahmad 5
|
||||
Beau 6
|
||||
dtype: int64
|
||||
```
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
```
|
||||
<pre>
|
||||
Tom 8
|
||||
Beau 6
|
||||
dtype: int64
|
||||
```
|
||||
</pre>
|
||||
|
||||
## --video-solution--
|
||||
|
||||
|
@ -21,13 +21,13 @@ More resources:
|
||||
|
||||
Given a file named `certificates.csv` with these contents:
|
||||
|
||||
```
|
||||
<pre>
|
||||
Name$Certificates$Time (in months)
|
||||
Tom$8$16
|
||||
Kris$2$5
|
||||
Ahmad$5$9
|
||||
Beau$6$12
|
||||
```
|
||||
</pre>
|
||||
|
||||
Fill in the blanks for the missing arguments below:
|
||||
|
||||
|
@ -12,10 +12,10 @@ dashedName: loading-data-and-advanced-indexing
|
||||
|
||||
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?
|
||||
|
||||
|
Reference in New Issue
Block a user