1 of 12

Lecture 5

Tables

DATA 8

Spring 2017

Slides created by John DeNero (denero@berkeley.edu)

2 of 12

Announcements

3 of 12

Puzzle of the Day

Among all 685 responses to the Data 8 Welcome Survey:

  • How many people have your birthday?
  • How many days have at least 2 people with that birthday?
  • How many days have at least 4 people with that birthday?
  • What's the largest number of people that all have the same birthday?

4 of 12

Tables

5 of 12

Table Structure

  • A Table is a sequence of labeled columns
  • Labels are strings
  • Columns are arrays, all with the same length

Name

Code

Area (m2)

California

CA

163696

Nevada

NV

110567

Label

Column

Row

(Demo)

6 of 12

Minard's Map

7 of 12

Charles Joseph Minard, 1781-1870

  • French civil engineer who created one of the greatest graphs of all time
  • Visualized Napoleon's 1812 invasion of Russia, including
    • the number of soldiers
    • the direction of the march
    • the latitude and longitude of each city
    • the temperature on the return journey
    • Dates in November and December

8 of 12

Visualization of 1812 March

9 of 12

Different types of data

float:

decimal number

int: integer

string:

text

10 of 12

Birthdays

11 of 12

Puzzle of the Day

Among all 685 responses to the Data 8 Welcome Survey:

  • How many people have your birthday?
  • How many days have at least 2 people with that birthday?
  • How many days have at least 4 people with that birthday?
  • What's the largest number of people that all have the same birthday?

12 of 12

Birthdays in Data 8

685 responses; 202 repeated birthdays