Verifique si la entrada es Pandas DataFrame
if isinstance(x, pd.DataFrame):
... # do something
Real Raccoon
if isinstance(x, pd.DataFrame):
... # do something