Jupyter Notebooks (US Wk 3) Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

How to open a jupyter notebook?

A

Anaconda command prompt: jupyter notebook (opens in browser)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

reference the output of the last executed cell

A

underscore. _ * 3&raquo_space; last output * 3

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Keyboard shortcut to switch arrows from navigating in a cell to navigating amongst cells

A

Esc from within the cell, then “enter” to enter a cell

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a markdown cell in a jupyter notebook?

A

Allows you to format using headings, bold, latex equations, lists, etc

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do you save a non-executable version of the notebook?

A

File save as – HTML

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

execute unix command in notebook, eg ls directory

A

!ls . (exclamation point before)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

store the filename in a variable

A

filename = ‘filename.txt’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

unix command to count the number of lines in the file, w/ var filename

A

!wc -l $filename (need the $ on the variable)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

unix command to get the value of variable filename

A

!echo $filename

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

count the lines in a filename with word liberty

A

!grep -o ‘liberty’ $filename | wc -l

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

replace blueberries with apples and output to a new file

A

!sed -e ‘s/Apples/Blueberries/g’ ‘fruits2.txt’ > fruits3.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly