This repository collects the documents for the Python Course for Scientific Programming offered for SCN2 (Societat Catalana de Nanociència i Nanotecnologia)
View the Project on GitHub LLACorp/Python-Course-for-Scientific-Programming
This course is aimed to be a 5 lecture long intensive introduction to Python. Each lesson will be 2 hours long. During the first hour (aproximately) of each module, the lecturer will expose the concepts wrtting code in situ in a computer, the screen of which will be projected such that all the audience can read it. The lesson will be exposed in a Jupyter Notebook such that each code line can be immediately executed and its outputs visualized in any future time. The idea is that each of the students will have access to a computer with Spyder or Jupyter Notebook IDEs, so that they can follow the lecturer by typing concurrently the same exposed code. The lesson will merge the explanation of basic concepts with usage examples that will make the lectures very practice-oriented. During the second part of each module, a list of problems related to the concepts explained that same day will be proposed and the attendants will be encouraged to solve them on their own. The lecturer and his helpers will wander around the class to assist the students that need help with particular problems, concerns or misconceptions.
After each day, the Notebook generated by the lecturer will be uploaded to this same public Github repository and be open for any student.
In what follows, the topics covered in each of the lessons will be indexed.
Insatllation of the Anaconda module (the easy way to get Python together with the IDEs, such as Spyder or Jupyter, as well as the main libraries for scientific programming -numpy, scipy, matplotlib…-). The students will already have it insatalled in their computers, still the general lines will be exposed, such that they will be able to access Python in their home-computers as well.
print() and input() functions and the data types (int, float, boolean…)
Strings (maybe together with lists)
Variables and assignation
Mathemathical operators (*, /, **, %, …)
if, elif, else statements and the logical operators (==, !=, <, >=, …)
list structures: usage, slicing, indexing, appending…
Retake the conditional statements
for loops and the use of the range() function
while loops
break and continue statements for loops
Dictionary structures: keys(), items() …
List comprehension look over
zip(), enumerate() and iteration over structures
Function definition, arguments, call and usage. Return options.
Recursive vs Iterative look over: classical examples -Fibonacci series…-
numpy arrays and matrices
Array functions: invert(), transpose(), …
Understand the importance of googling whenever one needs to make a particular manipulation on the data: as an example, we could see array slicing, appending numbers or element wise operations
Random number generators
Basic data manipulation: mean(), standar deviation sd(), Linear Interpolation and regression
2D scatter-plots, lines, error bars, …
3D surface plot, heat map and contour plots
Open, read and write files
How to output and input data from and to numpy from external .txt files or .npy files
Mention of further topics not covered in the course but with practical relevance for further self-study: Objects and classes, yield statement in functions, assertions and error control (try-execpt), map-s and lambda functions, using conda install to obtain libraries that are not included in Anaconda…