if statement – How to send variable created in if to elif in python?

I am trying to access a data frame created in an if condition from an elif but getting an error. How do I pass a Data Frame created in if to elif?

if df(col).dtype == 'int':
   (some operations)
   df1 = df
elif df(col).dtype == 'obj':

NameError: name ‘df1’ is not defined