There is no requirement to participate in the lectures. You will be able to watch the videos later. However, it is recommended to participate as that gives you an opportunity to ask questions.
Each video will be around 1 hour long. In order to make it easier to access the specific topics I would like to add timestamps to each video. A timestamp looks like this:
00:00 Start
01:30 Installation
Meaning at 1 minute 30 seconds I started to talk about Installation.
I'll need volunteers to prepare these timestamps for each video on the day after the lecture. You basically need to watch the video and write down all the points where you think you or someone else would like to jump to. You can see such timestamps in the comments of many YouTube videos. We will have an issue where you'll be able to volunteer.
There will be assignments after every lecture. You will submit them via GitHub. I'll explain the details during the lectures.
Towards the end of the course you'll be asked to do a project. First you need to submit a proposal for the project and when it is accepted then implement it. The project should be something that is useful for your studies or at least it is fun for you to make. Ask in the lab where you work what needs are there that you might implement as your final project. You can get inspiration from the projects listed here and the projects of the 2023 autumn semester.
Each assignment counts as 5% (we will have 10 of them).
The project proposal is 15%.
The project is 35%.
The project is a requirement. Without that you won't get a passing grade.
During the course I'll use some of the slides that can be found here. These slides are publicly available and will remain on the web site after the course is over.
There are recording of this course from 3 years ago.
There are also recordings from the 2023 autumn semester.
You can watch those, but be also warned, this semester the order of the material will be different.
There are many more videos in my English-language YouTube channel. You are invited to check them out and to follow the channel.
Some of the material is also available in Hebrew. You can find them on my website and in my Hebrew-language YouTube channel. You are invited to follow that channel as well.
The standard language of WIS and of this course is English.
However, when on one-on-one conversions I'd be happy to speak in Hebrew, Hungarian, Spanish, or Ladino.
There is no need to install anything up front. We'll do that during the lectures.
Day 1 part 1 - About GitHub and programming
Day 1 part 2 - GitHub pages via the GitHub UI
_config.yml
Day 1 part 3 - Installing git on Windows, Setup, simple use; Installing VS Code
Overview:
Duck Duck Go search engine.
GitHub:
The [cm-demo GitHub user]()
Install gis-scm
Install VS Code
Create GitHub Pages
Markdown and GitHub Flavored Markdown
Command line Git.
Configure git client
git config --global user.email your@mail.address.com
git config --global user.name "Your Name"
Git commands:
git clone ...
git status
git add
git commit -m "some explanation"
git push
ssh-keygen (just press ENTER several times accepting all the defaults)
cat ~/.ssh/....pub
pwd print working directory
cd /c/Users change directory
In the File Explorer click on "view" and then mark the check-boxes: "File name extensions" and "Hidden items"
Create your own GitHub
Create you own web site on GitHub pages
Open an issue on our shared GitHub project with the link to that site and to the repository.
Dead-line 2024.04.15 24:00
Day 2 part 1 - Installing VS Code and Python on Windows
Day 2 part 2 - Getting input from STDIN
Day 2 part 3 - flow control: if, while, and break
git mv
if
condition and else
==
lower()
capitalize
()
while
break
Ctrl-C
random.random
random.randrange
git mv
?Review assignment
How to follow a GitHub repository
Star a GitHub repository
VS Code
Install Python.
Start writing Python code in VS Code.
day02/hello_world.py
input
.Keep the repository up to date.
git diff
git mv
On your "home page" (the one you created last week)
Setup notifications and "star" the repository.
Create a new public repository where you are going to publish all of your assignments. (It should be different from your homepage).
Write a Python program that is a number guessing game:
In your assignment repository create a folder called "day02" and put your submitted solution there.
Open an issue on our project with a link to the repository where you have the solution.
Dead-line 2024.04.30 24:00
Day 3 part 1 - Git, code-formatting, random.py
00:05 Repository cloning.
03:52 Several ways of creating github repositories and connecting them to github
04:50 How to clone empty repository
07:25 Opening visual studio code from bash commend
13:50 additional git commands
16:53 GitHub Actions errors of the GitHub Pages of Mazal
29:00 Code formatting importance
31:00 Install and use black for code formatting: (beautifier, prettifyer, code formatter)
34:00 Opening terminal from visual studio code
35:40 Example of how to use black
40:50 Create program called random.py and have it also import random.
Some students needed help.
The GitHub Actions errors of the GitHub Pages of Mazal.
Install and use black for code formatting:( beautifier, prettifyer, code formatter)
Create program called random.py and have it also import random.
__pycache__
folder..DS_Store
.__pycache__
folder. First remove with git rm
and then add the name to .gitignore
.01:07 write a function that given a string of digits, and count how many times each digits appear.
04:08 how and in which order python read the function
06:25 using a list and counting digits in python
11:15 how to access a specific element from a list
13:00 go back to counting digits
31:10 separate the display function
33:37 how to skip spaces from counting
Take the rectangle example and convert into 4 functions, including the main function.
Count digits
write a function that given a string of digits, count how many times each digit appears; (use a list)
define a list and access its elements
add spaces to the string and skip them in counting.
add other characters to the string and skip them in counting.
Visit the home pages of some of the students. Pick two students you don't know yet and who don't have issues opened yet.
@szabgab
so I'll be notified.When you receive such an issue, please react to it. Once you finished implementing whatever it suggested (if there was anything), then close it.
Create a folder called "day03". Take the solution from the previous assignment, the number guessing game, copy it to the new "day03" folder and make some changes
main
and split up the code into several function that make sense.Dead-line 2024.05.08 16:00
Factorial
n! f(n) = n*(n-1)*(n-2) .... 1
f(1) = 1
f(n) = n * f(n-1)
Fibonacci
1, 1, 2, 3, 5, 8, 13, ...
f(1) = 1
f(2) = 1
f(n) = f(n-1) + f(n-2)
Do not comment unnecessarily:
exit() # end the program
An example when comments go bad:
counter = 0
counter += 2 # add 1 to the counter
Comment where things are unclear:
score = (round(100 * (1 - ((n - 1) / 19)) * (1 / (1 + (0.004 * t)))))
Explain "why" not the "what"
Create a folder called day04
and write a program that given a filename on the command line will print the following:
python count.py FILENAME
pip install pytest
Take the Fibonacci function and move to a module. Write tests.
area function with a bug
pytest --doctest-modules mymath.py
Create a folder called day05
copy your solution from day 4 (character, word, and line counting)
Change it to have separate function(s) that do the "business logic".
Move that to a separate "library" file.
Write tests for these functions. (Some people had one function some had several. Either way is fine.)
Dead-line 2024.05.21 22:00
Day 6 part 1 - TIMESTAMP MISSING
Slides of Python and Excel
Slides of YAML
Create a folder called day6 and in it:
Find an important Excel or CSV file in the lab where you work and write a program that will do some computation on it. Include a sample of the data file and write a test that will verify the results given that input file.
If you don't work in any lab, ask the other participants of the course for a file. Worst case you can download a file from Kaggle.
If the files you have contain data that you don't want to be public, replace the real data with fake values.
I know that "some computation" is rather vague, but that's because in each case something els might make sense.
Calculation might be summing up certain numbers or maybe doing a slightly more complex calculation on the data. Maybe collecing and listing some values that might be numerical or textual.
Please also add a README.md to the day6 folder explaining in a few words or few sentences what the data is and what kind of computation you do.
Create virtual environment:
virtualenv -p python3 venv
Start virtual envrionment:
source venv/bin/activate
On Windows it is probably started by running .\venv\bin\activate.bat
pip install pytest
pip install -r requirements.txt
$ pip freeze
et-xmlfile==1.1.0
iniconfig==2.0.0
openpyxl==3.1.3
packaging==24.0
pluggy==1.5.0
pytest==8.2.1
Discuss the warnings in day6 project of Yael - Show the way Roi hides them
Introduce the requirements.txt file (see the project of Yuval)
Boyue - show the problem with the hard-coded path
The problem with having code in the body of the program Meir
Review the code of Maher (unittest, __name__
, hard-coded filename)
Roi - test generates an image should be either in gitignore or better yet in a temporary folder
Testing using the file (Shahar)
Talk about the project, set date for project proposals
Getting data from web sites Open Weathermap API
Create day07 folder
Write a command line tool that can download data from NCBI. You can download from the nucleotide database as we did in the lecture, but it would be much more interesting if you used some of the other databases available on NCBI. e.g.:
python ncbi.py TERM NUMBER
Search for the TERM and download up to NUMBER items.Save each item in its own file. Print the names of the files. Also save the date, the search term, the number asked for and the total number of items found in a csv file. So if you run it twice
python ncbi.py Orchid 3
python ncbi.py cauliflower 7
you'd get something like this:
date,term,max,total
2024-05-30 17:20:21,Orchid,3,527341
2024-05-30 18:12:34,cauliflower,7,32781
Add a README.md
that explain what the program does.
As I explained in the lecture you will have to write a project that is hopefully going to be useful or fun for you.
Size: about 4 times bigger than a weekly assignment.
Create a new git repository and in the README.md
file describe the project. Add links to explanations and images if necessary.
This is the project proposal and this will also become the user-documentation.
The proposal should include the scientific background of the project and the technical, programming part.
The scientific part will likely include many terms I am not familiar with. Please include links to explanations. This part should also include the explain about the models and how the data is processed. If you use well-known algorithms then please link to explanations.
The technical part is mostly "standard", but it is better to be explicit about it. So:
pip install -r requirements.txt
.pytest
and that should run the tests.python project.py input-1.csv input-2.csv
.If your project relies on some data (most likely it will), then include some data files in the repository. The actual values in the file can be fake, but the format of the file should be the same as the file(s) you already have.
Please give the project a real title that is meaningful to other researchers and not just "project", after all these projects are expected to have value way beyond being projects for this course. Name the repository accordingly.
It would be nice if the README had a reference to the course e.g. a link back to our repo something like this,
This project was originally implemented as part of the Python programming course at the Weizmann Institute of Science taught by Gabor Szabo
but beyond that it is just a stand-alone project.
Open an issue on our repository with a link to this repo.
Day 8 part 1 - TIMESTAMP MISSING
Day 8 part 2 - TIMESTAMP MISSING
pip install spyder
input
.pip install jupyter
jupyter lab
jupyter notebook
One of the following two in the day08
folder:
Take the number guessing game and create GUI for it using Tk.
Create a GUI for the ncbi.py of the previous assignment.
README.md
in the day08
folder.requrements.txt
if necessary.I'd strongly recommend that before you submit the solution to me, show it to one of the other students and let that person try it.
Day 9 part 1 - Refactoring code, Making improvements and adding features
Day 9 part 2 - Argparse
Day 9 part 3 - Regular Expressions
Working on the program written by Thea Meimoun day7 - merge functions
ncbi_original.py
ncbi_shared.py
ncbi_download_folder.py
ncbi_argparse.py
check_number_with_regex.py
check_double_letters_with_regex.py
dna_with_regex.py
We saw one example analyzing sequences: find the longest sub-sequence that repeates itself. In the day9 folder create a program that will receive the path to a file in Fasta or GeneBank format, and use the above analyzis to print out the longest sub-sequence that appears twice.
Then come up with some other "interesting feature" of sequences and add that analyzis too. Make both analyzis optional and let the user control which one is done: (assuming this second analyzis is called blabla you could use the program like this:
python analyze.py FILE --duplicate --blabla
What is an "interesting feature" is up to you. It can be a real, scientifically valuable feature, but if that's too difficult it can be some simpe feature like the repetition we have.
Include a README.md
file and the requirements.txt
file if necessary.
Day 10 part 1 - numpy
Day 10 part 2 - numpy
Day 10 part 3 - pandas, machine learning
Code Mavens virtual presentations about Python (and other languages) in English.
PyWeb-IL Python meetings in Hebrew
PyData Meetups about Python and data in Hebrew.
Exercism to practice programming and get human feedback.
LinkedIn social network for jobs.
Make sure you have sent the timestamps for at least one of the videos.
Dead-line 2024.06.23 22:00
Use the repository you created for the project.
Once you are done ask another student to check your project without telling the students anything about the project. Only give the link to the repo.
Fix any issues the student might have.
Open an issue letting me know when you are done.
Dead-line 2024.07.10 22:00