1. Learn
  2. /
  3. Courses
  4. /
  5. Exploring and Analyzing Data in Python

Exercise

Making predictions

At this point, we have a model that predicts income using age, education, and sex.

Let's see what it predicts for different levels of education, holding age constant.

Instructions

100 XP
  • Using np.linspace(), add a variable named 'educ' to df with a range of values from 0 to 20.
  • Add a variable named 'age' with the constant value 30.
  • Use df to generate predicted income as a function of education.