when my function f is called with a variable I want to check if var is a pandas dataframe:
def f(var): if var == pd.DataFrame(): print \"do stuff
Use the built-in isinstance() function.
isinstance()
import pandas as pd def f(var): if isinstance(var, pd.DataFrame): print("do stuff")