Get startedGet started for free

Correcting a function error

The code in the script editor should plot information from the DataFrame that we loaded in the previous exercise.

However, there is an error in function syntax. Remember that common function errors include:

  • Forgetting closing parenthesis
  • Forgetting commas between each argument

Note that all arguments to the functions are correct. The problem is in the function syntax.

This exercise is part of the course

Introduction to Data Science in Python

View Course

Exercise instructions

  • Correct the code so that it runs without syntax errors.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# One or more of the following lines contains an error
# Correct it so that it runs without producing syntax errors

# Plot a graph
plt.plot(x_values y_values)

# Display the graph
plt.show()
Edit and Run Code