- Instructor: Kevin Cunningham
- 09.00-10.30 - Session 1
- 10.30-11.00 - Break
- 11.00-12.30 - Session 2
- 12.30-13.30 - Lunch
- 13.30-15.00 - Session 3
This three-day course offers a practical, hands-on journey into the world of Python programming. We'll cover the essential language features and build your skills progressively. To make the learning concrete and relevant for scientists and engineers, our labs follow a central theme: analyzing experimental and sensor data. You'll start with basic scripts and build up to a final project that loads (or optionally fetches) measurement data, processes it using classes and functions, and generates an analysis report. By the end, you'll have the confidence to apply Python to practical data-handling tasks in the lab or in research.
- Overview of the course structure
- Learning objectives and outcomes
- Introduction to Python and its significance
- Basic syntax and structure of Python
- Running Python scripts and using the interactive shell
- Writing your first Python program
- Understanding Python's built-in data types
- Working with numbers, strings, lists, tuples, and dictionaries
- Type conversions and basic operations
- Conditional statements:
if,elif, andelse - Loops:
forandwhile - Controlling loop execution with
break,continue, andelse
- Advanced data structures in Python
- Working with tuples, lists, sets, and dictionaries
- Performing basic data analysis
- Defining and calling functions
- Function arguments, return values, and scope
- Lambda functions and functional programming concepts
- Understanding and using list comprehensions
- A concise way to create lists
- Practical examples and use cases
- Introduction to classes and objects
- Defining classes and creating instances
- Understanding
self, constructors, and methods
- Organizing code into modules
- Importing and using Python's standard and third-party libraries
- Best practices for module design and usage
- Exception handling in Python with
try,except,finally - Raising exceptions and custom exception classes
- Debugging and error management strategies
- Writing tests in Python using
pytest - Test-driven development (TDD) principles
- Mocking and coverage analysis
- Reading from and writing to files
- Working with JSON data
- Fetching live data from a web API
- Introduction to data visualization with Matplotlib
- Creating basic plots, charts, and graphs
- Customizing and exporting visualizations
- Understanding Python generators and
yield - Creating and using generator functions
- Practical examples of using generators for efficiency