Introduction to NumPy with Vineet Bansal, Research Computing Bootcamp

Wed, Jan 20, 2021, 1:30 pm
Speaker(s): 
Sponsor(s): 
Center for Statistics and Machine Learning
Princeton Institute for Computational Science & Engineering (PICSciE) and OIT Research Computing

Full event details and registration link here.

This session covers the basics of NumPy, the package that underlies most scientific computing done in Python. It will explain the NumPy array, the principal data type in the NumPy package, and how it differs from similar Python structures like lists. There will be particular emphasis on understanding the two core features of NumPy arrays – vectorization and broadcasting – and how they can be leveraged to write concise and powerful scientific code in Python. There will be hands-on exercises, including with multidimensional arrays.

This session is ideal for those who already use Python and are either new to NumPy or have used NumPy before but would like to develop more comfort with its syntax, underlying data model, and performance features.

Learning objectives

Participants will learn the basic syntax of NumPy arrays, as well as important dos and don’ts for how to use them effectively in their own applications. Participants will also gain awareness of useful NumPy subpackages and leave with enough know-how to incorporate those packages into their own codes.

Knowledge prerequisites

Participants should have reasonable facility with the Python programming language, and in particular how Python lists work (how to access list elements, slicing notation, the underlying data storage model, etc). This session is not appropriate for those with no prior Python experience. However, no previous experience with NumPy is required.

Hardware/software prerequisites

Overarching requirements for all PICSciE virtual workshops are listed on the advance setup guide for PICSciE virtual workshops. In addition, for the hands-on portions of this session, participants should install the Anaconda Python 3 distribution – which includes Jupyter notebooks and NumPy – on their laptops in advance. Instructions can be found on the PICSciE virtual workshops requirements page.

Alternately, participants without Python 3 installed on their laptops who prefer to run Jupyter Notebooks remotely on one of Princeton’s systems can do so the “myadroit” web interface to the Adroit cluster. To access myadroit, you should first register for an account on Adroit, as described in the advance setup guide for PICSciE virtual workshops. Then, connect to “myadroit” and start a Jupyter session, as described here.

Session format

Presentation, demo, and hands-on


Questions? Contact rcinfo@princeton.edu.