Clinic
Python
ˋˋˋpython
import foo
a = 1
foo.bar(1)
ˋˋˋ
Same as
ˋˋˋpython
from foo import bar
a = 1
bar(1)
ˋˋˋ
Visualization
- earlier in the week
- present higher level lib (plotly, seaborn, bokeh...)
- Several users have had issues with plotting via wsl. Getting some qt warming and no image showing.
For some this worked
ˋˋˋ
conda uninstall matplotlib
pip install matplolib
ˋˋˋ
Misc
- reduce amount
- try to have terminal and slides on a single screen and avoid switching
- for windows users, maybe consider NOT using WSL unless for the bash section of the course: these people are likely to be using python NOT via WSL on an everyday basis, I am not sure it makes sense to add more hoops for them to jump through by forcing them to use WSL (also because WSL can cause extra problems and slow these people during the course)
- see: https://hyper-neuro.slack.com/archives/C06EGRL8ND7/p1715870869762009
Clinic
Python
split the module with one for beginners and one more advanced
Things to mention as it is confusing a few people.
ˋˋˋpython
import foo
a = 1
foo.bar(1)
ˋˋˋ
Same as
ˋˋˋpython
from foo import bar
a = 1
bar(1)
ˋˋˋ
When writing python code for other modules, try to rely on coding syntax that students may be familiar from other languages and avoid "pythonic idioms" or "one liners". For example
Increment operator +=
List / dict comprehension
One liner with Tuple unpacking on returned values
ˋˋˋpython
import foo
a = foo.bar(b)[0]
ˋˋˋ
instead of
ˋˋˋpython
from foo import bar
tmp = bar(b)
a = tmp[0]
ˋˋˋ
Also where possible name all paramaters when calling a function foo(model=a, parameters=b) instead of
f(a, b)Visualization
For some this worked
ˋˋˋ
conda uninstall matplotlib
pip install matplolib
ˋˋˋ
Misc