4 Julia as a spreadsheet

 

This chapter covers

  • Working with collections of numbers using the Array and 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 filter function

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 (figure 4.1).

Figure 4.1 Apple Numbers is a spreadsheet application for working with rows and columns of numbers.
04-01

In these applications, numbers are stored in tables. All serious scientific work involves working with large tables of data, including whole columns of numbers. Scientists and data analysts get survey data or measurements they want to analyze. Julia is excellent for this type of work. You are not literally working with a graphical spreadsheet tool, but you are manipulating data in table form, much like a modern spreadsheet application.

4.1 Analyzing pizza sales

4.2 Different types of arrays

4.3 Performing operations on arrays

4.4 Working with the statistics module

4.5 Accessing elements

4.6 Creating arrays

4.7 Mapping values in an array

4.8 Introducing characters and strings

4.9 Storing pizza data in tuples

4.10 Filtering pizzas based on predicates

4.10.1 Combining higher-order functions

4.11 Mapping and reducing an array