This chapter covers
- Working with collections of numbers using the
Arrayand Tuple` types
- Useful types to put into collections such as numbers, characters and text strings
- Performing statistics
- Transforming lists of numbers with
map
- Using predicates with the
filterfunction
In the second chapter we discussed how to work with Julia as a calculator. However people working with numbers today, don’t usually use desk calculators. They use spreadsheet tools such as Microsoft Excel or Apple Numbers.
In these applications numbers are stored in tables. We work with whole columns of numbers. All serious scientific work involves working with large tables of data. Scientists and data analysts get survey data or measurements they want to analyze. Julia is excellent for this type of work. However we will only scratch the surface of what is possible to do in this chapter. Instead the main purpose is to introduce the Array and Tuple datatypes. Because these are containers for other values, we will also touch upon the Char (character) and String (text string) types to have something interesting to put in our arrays and tuples.
In fact we are going to put numbers, characters, text strings and Boolean values into these two collection types.