python check if is pandas dataframe

import pandas as pd
isinstance(df, pd.DataFrame)

Here is what the above code is Doing:
1. We’re checking if the df variable is an instance of the pd.DataFrame class.
2. If it is, then the isinstance() function returns True.
3. If it isn’t, then the isinstance() function returns False.