Python Check If Dataframe Is Not Defined Error In Python