Essential knowledge Flashcards
(For NYJC Exams only)
What is the Powershell command to launch Jupyter Notebook in E: drive?
cd E:
jupyter notebook
How to rename a file in File Explorer (without using right click)?
From menu, Home –> Rename
or
Use F2 shortcut key
What is the shortcut key to delete a cell in Jupyter Notebook?
Select a cell first. Then press D, D (press D twice)
What is the shortcut key to insert a cell in Jupyter Notebook?
A to insert above current cell
B to insert below current cell
How to show line numbers in Jupyter Notebook?
Under the View menu, click “Toggle Line Numbers”
How to show line numbers in IDLE?
You can’t; the version of IDLE in the SSOE laptops does not support line numbers. Edit in Notepad++ and copy back instead.
How to access the extended clipboard in Windows?
Win+V (hold Windows key, press V)
The minimal Python code to read in a csv file (with header) is:
import csv
data = []
with open(filename, ‘r’) as f:
for row in csv.DictReader(f):
data.append(row)
# f.close() is automatically called
# data is a list of dicts
The minimal Python code to read in a csv file (without header) is:
import csv
data = []
with open(filename, ‘r’) as f:
for row in csv.reader(f):
data.append(row)
# f.close() is automatically called
# data is a list of tuples