pip install jupyter_contrib_nbextensions
pip install jupyter_nbextensions_configurator
jupyter contrib nbextension install --user
jupyter nbextensions_configurator enable --user
-
Download the wheel called
tensorflow-2.4.1-py3-none-any.whl
located at this public google drive link:
drive.google.com/drive/folders/1oSipZLnoeQB0Awz8U68KYeCPsULy_dQ7 -
Assuming you downloaded the wheel to your Downloads folder, install it with pip:
$ pip install ~/Downloads/tensorflow-2.4.1-py3-none-any.whl --user
-
Test that it works with
ipython
at the command line:
"""Check for 3rd party package, if not present, pip install it. | |
This is potentially dangerous code. It should only be used for educational purposes. | |
Defining a requirements.txt is one of the much better options. | |
""" | |
from importlib import import_module | |
module_name = 'pytest' |
What | How |
---|---|
Fix Unicode encoding errors | import ftfy ftfy.fix_text('✔ No problems') |
Remove specific words | s = s.replace("foo", "") |
Remove punctuation | import string s = s.translate(str.maketrans('', '', string.punctuation)) |
Remove hyperlinks | import re s = re.sub(r"https?://\S+", "", s) |
# Solutions | |
sumTotal = 42 # Valid | |
# sum-total = 42 # Invalid. Dashes are a no-no. | |
sum_total = 42 | |
# sum total = 42 # Invalid. Spaces are a no-no. White space is often meaningful in Python. | |
sum_total = 42 |
Find out if each of the following is either an acceptable or not acceptable Python identifier.
Do this by trying to assign them as an identifier for a variable.
If you get a SyntaxError: can't assign to operator
, fix the error by changing the identifier.
- sumTotal
- sumtotal
- sum-total
- sum total
Do not be the person who has practiced 10,000 things once, but be the person who has practiced one thing 10,000 times.
— Intentionally misquoting Bruce Lee
- Write a lot of code. Physically type code and run it (if either part is missing, it is not quality code practice).
- Think of coding practice as a portfolio. It should be a mix:
- 40-60% Easy-for-you fundamentals. Practicing Pythonic idioms to solve common atomic problems. This develops fluency to solve novel challenges and build up to more advanced coding.
- 20-30% Difficult-but-possible problems. LeetCode and similar is good for this level.