Jupyter Notebooks Flashcards

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

JP: What is a Jupyter Notebook, and what is its high-level purpose?

A

Jupyter notebooks allow you to run code, display outputs and visualizations, and cleanly write accompanying text, all within one page in the web browser.

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

JP: Why do Jupyter notebooks make editing code easier? What is a way it particularly makes it easier for data science?

A

They allow you to edit and rerun only one chunk of code rather than all of it. For data science, this is especially helpful as you only need to load the data once, rather than rerunning a script over and over. (This is my assessment, not someone well informed’s.)

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

JP: How do you start a new notebook on your machine?

A

Because you have anaconda, simply run “jupyter notebook” at command line, then do “New -> Python 3” to start.

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

JP: How can you tell if you’re in edit mode?

A

There is a pencil icon in the top right corner of your window.

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

JP: Hot key to run a cell and move to next

A

Shift + enter

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

JP: What do the numbers next to the cells show?

A

The order in which cells were run

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

JP: How do we allow matplotlib plots to be used in our notebook

A

Run the line magic command “%matplotlib inline”

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

JP: How to simply time the execution of a python code block?

A

Include cell magic command “%%timeit” at top of cell

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

JP: Can you display the results of many evaluations without printing them?

A

Yes

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

JP: What does the star in brackets mean?

A

The code cell is still executing

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

JP: How do you quickly delete a cell?

A

Click the left part of the cell to view it in command mode, then hit d twice quickly

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

JP: Hotkey for inserting cell above

A

A (in command mode)

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

JP: Hotkey for inserting cell below

A

B (in command mode)

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

JP: Hotkey for changing cell to markdown

A

M (in command mode)

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

JP: Hotkey for changing cell to code

A

Y (in command mode)

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