DS Scientific Programming Lab
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
Exercises difficult
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
Long exercise: Word Frequency Analysis
Module 1, Practical 7
Gentle reminder on functions
Getting input from the command line
Argparse
Libraries installation for the next practicals
Exercises
1st ML model
Machine Learning
What is k-Nearest Neighbors (k-NN)?
Main Idea Behind k-NN
For instance:
todo
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
Module 1, Exams
Exams and Simulation
DS Scientific Programming Lab
Module 1, Exams
¶
Exams and Simulation
¶
Sim.
5 11 24