Skip to content
Exit presentation

Data Handling I: Organizing & Visualizing Data

The big picture

One list, one loop. Every number here was worked out from them.

Data Handling I — eight ideas, in order
IdeaRememberExample
A row of values.length counts a list. 0 for an empty one.7 readings, 7
Reaching one of themPositions start at 0. Last is .length - 1.week[4] is Friday
Building it up.push() adds one value to the end.meals grows to 6
Adding them all upA total box outside the loop.0 → 28 → 59 → … → 166
The mean in codeTotal ÷ count, as a function.70 ÷ 7 = 10
Biggest and smallestWalk once, keep the best so far.78 is the heaviest
Counting into groupsA tally list, one slot per group.5, 3, 0, 4, 3, 3
Drawing it from the listBars are the printed counts.4 cells for tomato

Two numbers came up again and again. One is the count: .length, the loop's turns, the mean's divisor. The divisor is the number you divide by. The other is the position. The first position is 0 and the last is .length - 1.

Now the program does by machine what you once did on paper.

Jump to lesson

This track

  1. 0 Start here
  2. 1 One list holds the whole week
  3. 2 Every item has a position
  4. 3 A list the program builds itself
  5. 4 One box outside the loop
  6. 5 Total divided by count
  7. 6 The biggest, without sorting
  8. 7 One count per group
  9. 8 The chart the program drew
  10. 9 The big picture
  11. 10 Track quiz

Other tracks