• Home
  • 1. Data science for everyone
    • 1.1 What is data science?
    • 1.2 Why data science?
    • 1.3 Tools and techniques
    • 1.3.1 Computational tools
    • 1.3.2 Statistical techniques
    • 1.4 Plotting the classics
    • 1.4.1 Literary characters
    • 1.4.2 Another kind of character
  • 2. Programming
    • 2.1 A sampling problem
    • 2.2 A simpler problem
    • 2.3 Expressions
    • 2.4 Variables
    • 2.5 Names
    • 2.6 Call expressions
  • 3. Data types
    • 3.1 Numbers
    • 3.2 Strings
    • 3.3 Comparison
    • 3.4 Arrays
    • 3.5 Ranges
    • 3.6 More on arrays
    • 3.7 Arrays and axes
    • 3.8 Reply to the Supreme Court
    • 3.9 Revision - three girls
    • 3.10 Selecting with arrays
  • 4. Data frames
    • 4.1 Introduction to data frames
  • 5. Permutations
    • 5.1 Population and permutation
    • 5.2 lists
    • 5.3 Iteration with For loops
    • 5.4 Indentation, indentation
    • 5.5 Ones and zeros
    • 5.6 A permutation test
  • 6. More on simulation
    • 6.1 Sorting arrays
    • 6.2 Monty hall problem
  • 7. More building blocks
    • 7.2 None
    • 7.1 Functions
    • 7.1 Functions as values
    • 7.2 Conditional statements
  • 8. The mean and straight line relationships
    • 8.1 The mean as a predictor
    • 8.2 Where and argmin
    • 8.3 Mean and slopes
    • 8.4 Optimization
    • 8.5 Finding lines
    • 8.6 Believable slopes
  • 9. Classification
    • 9.1 Standard scores
    • 9.2 Nearest neighbors
    • 9.3 Training and testing
    • 9.4 Rows of tables
    • 9.5 Implementing the classifier
    • 9.6 Accuracy of the classifier
  • 10. The end of the beginning
  • Exercises
    • Thinking about names
    • Three girl simulations
    • Array indexing
    • More simulations
    • Data frames
    • Brexit analysis
    • For loops
    • Money and death
    • Function exercises
    • Function as values exercises
    • Conditional statement exercises
  • Extra pages
    • More on lists
    • Monty Hall with lists
    • Berkeley introduction to functions
    • Deviations around the mean

  1. More building blocks

We have already covered some important parts of programming for data science, such as expressions, variables, data types, arrays and data frames.

In this section, you cover the last two building blocks you will need as a foundation for your future analyses.

These are:

  • Writing functions
  • Conditional statements
Previous Next