Skip to main content

Instructor-led training

Python for Scientists Training in Ringwood, New Jersey

This is a 5 - day course that provides a ramp - up to using Python for scientific and mathematical computing.

What you'll learn

This is a 5 - day course that provides a ramp - up to using Python for scientific and mathematical computing. Starting with the basics, it progresses to the most important Python modules for working with data, from arrays, to statistics, to plotting result s. The material is geared towards scientists and engineers. This is an intense, hands - on, programming class. All concepts are reinforced by informal practice during the lecture followed by lab exercises. Many labs build on earlier labs which helps student s retain the earlier material. Python for Programming is a practical introduction to a working programming language, not an academic overview of syntax and grammar. Students will immediately be able to use Python to complete tasks in the real world.

Private Training for Teams

This course is offered as private, instructor-led training for organizations, onsite in Ringwood, New Jersey or live online. Dates, delivery format, and course content are arranged around your team's requirements.

This course is not currently scheduled as a public class for individual enrollment.

Request Group Training

Prerequisites

Students should be comfortable working with files and folders, and should not be afraid o f the command line in Linux, Windows, or MacOS.

Course Outline

The Python Environment
Starting
Python
If the interpreter is not in your PATHs
Using the interpreter
Trying a few commands
The help() function
Running a Python script
Python scripts on UNIX
Python editors and IDEs

Getting Started
Using variables
Keywors
Built-in functions
Strings
Single-quoted string literals
Triple-quoted string literals
Raw string literals
Unicode literals
String operators and expressions
Converting among types
Writing to the screen
String formatting
Legacy string formatting
Command line parameters
Reading from the keyboard

Flow Control
About flow control
What’s with the white space?
if andelif
Conditional expressions
Relational and Boolean operators
while loops
Alternateways to exit as loop

Lists and Tuples
About Sequences
Lists
Tuples
Indexing and slicing
Iterating through a sequence
Functions for all sequences
Using enumerate()
Operators and keywords for sequences
The xrange()function
Nested sequences
List comprehensions
Generator expressions

Working with Files
Text file I/O
Opening a text file
The with block
Reading a text file
Writing a text file
Python for Scientists
“Binary” (raw, or non-delimited) data

Dictionaries and Sets
About dictionaries
When to use dictionaries
Creating dictionaries
Getting dictionary values
Iterating through a dictionary
Reading file data into a dictionary
Counting with dictionaries
About sets
Creating sets
Working with sets

Functions
Defining a function
Function parameters
Global variables
Variable scope
Returning values

Exception Handling
Syntax errors
Exceptions
Handling exceptions with try
Handling multiple exceptions
Handling generic exceptions
Ignoring exceptions
Using else
Cleaning up with finally
Re-raising exceptions
Raising a new exception
The standard exception hierarchy

OS Services
The os module
Environment variables
Launching external processes
Paths, directories, and filenames
Walking directory trees
Dates and times
Sending email

Pythonic Idioms
The Zen of Python
Common Python idioms
Packing and unpacking
Lambda functions
List comprehensions
Generators vs. iterators
Generator expressions
String tricks

Modules and Packages
What is a module?
The import statement
Where did the.pyc file come from?
Module search path
Zipped libraries
Creating Modules
Packages
Module aliases
When the batteries aren’t included

Objectives
Defining classes
Instance objects
Instance attributes
Methods
__init__
Properties
Class data
Inheritance
Multiple Inheritance
Base classes
Special methods
Pseudo-private variables
Static methods

Developer Tools
Program development
Comments
pylint
Customizing pylint
Unit testing
The unittest module
Creating a test class
Establishing success or failure
Startup and Cleanup
Running the tests
The Python debugger
Starting debug mode
Stepping through a program
Setting breakpoints
Debugging command reference
Benchmarking

XML and JSON
About XML
Normal approaches to XML
Which module to use?
Getting started with ElementTree
How ElementTree works
Creating a new XML Document
Parsing an XML Document
Navigating the XML Document
Using XPath
Advanced XPath

iPython
About iPython
Features of iPython
Starting iPython
Tab completion
Magic commands
Benchmarking
External commands
Enhanced help
Notebooks

numpy
Python’s scientific stack
numpy overview
Creating arrays
Creating ranges
Working with arrays
Shapes
Slicing and indexing
Indexing with Booleans
Stacking
Iterating
Tricks with arrays
Matrices
Data types
numpy functions

scipy
About scipy
Polynomials
Vectorizing functions
Subpackages
Getting help
Weave

A Tour of scipy subpackages
cluster
constants
fftpack
integrate
interpolate
io
linalg
ndimage
odr
optimize
signal
sparse
spatial
special
stats

pandas
About
pandas
Pandas architecture
Series
DataFrames
Data Alignment
Index Objects
Basic Indexing
Broadcasting
Removing entries
Time series
Reading Data

matplotlib
About matplotlib
matplotlib architecture
matplotlib Terminology
matplotlib keeps state
What else can you do?

Python Imaging Library
The PIL
Supported image file types
The Image class
Reading and writing
Creating thumbnails
Coordinate system
Cropping an
d pasting
Rotating, resizing, and flipping
Enhancing

What makes this material hard to master

The difficulty is mostly the step from general-purpose Python to array-oriented thinking. The syllabus builds toward that step in a deliberate order.

  • Core language first. Strings, lists and tuples, indexing and slicing, list comprehensions, generator expressions, dictionaries and sets, functions and scope, and exception handling with try, else and finally. These habits carry into every later module.
  • Working like a Python programmer. Pythonic idioms, packing and unpacking, lambda functions, generators versus iterators, modules and packages, and classes with properties, inheritance and special methods.
  • Tooling. pylint, the unittest module, the Python debugger, benchmarking and iPython (tab completion, magic commands, notebooks).
  • The scientific stack. numpy arrays, then scipy, then pandas, then matplotlib, and finally image handling with the Python Imaging Library.

Several misconceptions cause trouble in the numeric modules:

  • Treating an array like a list. Shapes, Boolean indexing, stacking and data types change how an expression behaves, and slicing an array does not always behave like slicing a list.
  • Writing explicit loops where the syllabus's "vectorizing functions" topic and numpy functions would do the work.
  • Expecting pandas to match rows by position. Its data alignment and index objects match by label, so mismatched indexes can give surprising results.
  • Forgetting that matplotlib keeps state, so a plot depends on what was drawn earlier in the session.

The scipy tour covers many subpackages, from integrate and optimize to stats and fftpack. The skill is knowing which one fits a problem and how to find its documentation.

Who it suits and what to take around it

The course is aimed at scientists and engineers. The only stated prerequisites are comfort with files and folders and no fear of the command line, so prior programming experience is not required. The first days cover the interpreter, variables, flow control and file I/O before any numerical work begins.

Developers who already write Python can still use it as a structured route into numpy, scipy, pandas and matplotlib. Those modules take up the second half of the syllabus.

For a next step, Python Data Analysis with NumPy and Pandas is a shorter course centered on array and tabular data work, useful for reinforcing those modules. Teams building larger analysis pipelines can continue with Advanced Data Processing using Python. The Python Programming learning guide lists the other options.

Illustrative scenarios

The scenarios below are illustrations of how the course material can be applied. They are not descriptions of specific organizations or of the course's lab exercises.

  • Instrument data cleanup. A lab team might receive raw binary and delimited files from several instruments. File I/O (including raw data), dictionaries for counting and grouping, and exception handling make the import robust. pandas Series, DataFrames, time series and data alignment can then merge the readings.
  • Fitting and signal analysis. An engineer might fit a calibration curve and smooth a noisy signal. numpy arrays hold the measurements, and scipy subpackages such as optimize, interpolate, signal and stats do the numerical work. matplotlib then plots the results.
  • Batch image and metadata handling. A research group might need thumbnails, crops and rotations for a large set of image files, along with metadata stored as XML or JSON. The Python Imaging Library, ElementTree with XPath, and the os module's directory-walking tools cover those tasks.

Using AI coding assistants with these topics

AI coding assistants are useful for drafting boilerplate: file-reading loops, matplotlib plotting code, pandas read-and-summarize steps and first-pass unit tests. They are weaker where scientific code fails quietly:

  • Shapes and broadcasting. Generated numpy code can run without error and still combine arrays along the wrong axis.
  • Data types. Integer versus floating-point behavior and silent type conversion can change numeric results.
  • Index alignment. pandas may produce missing values where labels do not match, and the generated code may not account for it.
  • Choice of method. An assistant may pick a scipy routine that does not suit your data, or call functions that differ from the library versions you use.

To verify, run the code on a small input whose answer you can compute by hand, and check shapes and dtypes at each step. Compare results against a known analytic case. Use the unittest module, pylint and the debugger, all covered in the syllabus, on anything an assistant generates. Review edge cases such as empty files, missing values and path handling before the code goes into regular use.

Frequently asked questions

What level is this course and what do I need beforehand?

It is a general-level, five-day course. You should be comfortable working with files and folders and not afraid of the command line on Linux, Windows or macOS. The syllabus starts with Python basics, so prior Python experience is not listed as a requirement.

What does the course cover?

It covers core Python (strings, sequences, dictionaries, functions, exceptions, modules, classes), developer tools (pylint, unittest, the debugger, iPython), XML and JSON, then numpy, scipy, pandas, matplotlib and the Python Imaging Library. The description says all concepts are reinforced with hands-on labs.

Can this be delivered privately for our team, onsite or online?

Yes. HSG delivers private training for organizations, either onsite at your location or live online.

Can the content be customized or matched to the Python version we use?

Private training can be customized, including tailoring to the technology versions your organization uses, current releases included. You can request a training proposal to discuss your topics and environment.

Training locations

Python for Scientists training across the U.S. and beyond.

We provide private Python for Scientists training for organizations, onsite at your location or live online, throughout the United States and internationally.

View all Python for Scientists training locations

Train your team with HSG

Private, instructor-led training customized for your organization.

  • Onsite or live online delivery
  • Customized curriculum
  • For a single employee or an entire team
  • Flexible scheduling
  • Experienced instructors
Request Group Training

Questions? Call us at 303.377.6176
or email info@hartmannsoftware.com

Ready to train your team?

Let's customize this training for your organization.

Tell us about your employees, your goals, and your preferred schedule. We'll prepare a training proposal covering scope, delivery format, and pricing.