Missing imports:

    import pandas as pd
    import numpy as np
    import matplotlib.pyplot as plt