DS Scientific Programming Lab
dev
Scientific Programming for DS
General Info
Timetable and lecture rooms
Equipment
Acknowledgements
Module 1, Practical 1
Setting up the environment
Linux on windows
A dual boot system
Our toolbox
Installing Python3 in Linux
Installing Python3 in Windows/Mac
OPTION 1:
OPTION 2 (easier):
The console
Visual Studio Code
The debugger
A quick Jupyter primer (just for your information, skip if not interested)
Installation
Let’s try together
Exercises
Module 1, Practical 2
Modules
Objects
Variables
Numeric types
Integers
Booleans
Real numbers
Strings
Methods for the str object
Exercises
Module 1, Practical 3
Lists
Operators for lists
Methods of the class list
From strings to lists (split method)
from list to strings (join method)
Exercises (LIST)
Tuples
Introduction to sets
Exercises
Exercises (difficult)
Module 1, Practical 4
Execution flow
Conditionals
The basic
if - else
statement
The
if - elif - else
statement
Loops
For loop
Looping over a range
Nested for loops
While loops
Exercises
Exercises (difficult)
Module 1, Practical 5
More on loops
Ternary operator
Break and continue
Continue statement
Break statement
List comprehension
Dictionaries
Functions working on dictionaries
Dictionary methods
Exercises
Module 1, Practical 6
Functions
Namespace and variable scope
Argument passing
Positional arguments
Passing arguments by keyword
Specifying default values
File input and output
Opening a file
Closing a file
Reading from a file
Writing to a file
String formatting with format
Exercises
Exercises
Exercises (difficult)
Module 1, Practical 7
Gentle reminder on functions
Getting input from the command line
Argparse
Libraries installation for the next practicals
Exercises
Module 1, Practical 8
Libraries installation
Pandas
Series
How to define and access a Series
Operator broadcasting
Filtering
Missing data
Computing stats
Plotting data
Pandas DataFrames
Define a DataFrame
Loading data from external files
Extract values by row and column
Broadcasting, filtering and computing stats
Merging DataFrames
Grouping
Exercises
Exercises (2) DS
Module 1, Practical 9
Numpy
Numpy ndarray
Random arrays
Numpy to and from pandas
Reshaping
Iterating over arrays and Indexing
Broadcasting and arithmetic functions
Filtering
Linear algebra
Matplotlib
Exercises
Module 1, Practical 10
Part 1
Part 2
Module 1, Exams
Simulation
Exams
DS Scientific Programming Lab
Module 1, Exams
¶
Simulation
¶
Sim.
8 11 22
with
solution
Exams
¶
Exam Part A
11 11 22
Exam Part A
19 01 23
Exam Part A
13 02 23