Arrays and Other Collections

2. Arrays and Other Collections#

So far, we have worked with individual numbers stored in variables. However, most scientific and mathematical problems require us to handle collections of data, such as the results from an experiment, the pixels in an image, or the coefficients of a system of equations.

This chapter introduces the Array, Julia’s most fundamental data structure for numerical computing. We will explore its most important forms: vectors (1D arrays) and matrices (2D arrays), which are the programming counterparts to the familiar mathematical objects. You will learn how to create, access, and manipulate these collections.

We will also cover two other versatile data structures: tuples, which are fast, unchangeable collections, and dictionaries, which store data using key-value pairs. Mastering these tools is essential for organizing data and writing effective scientific code.