Skip to content

Instantly share code, notes, and snippets.

@RaulMedeiros
Created August 20, 2020 11:31
Show Gist options
  • Save RaulMedeiros/66c7b265058c3aa44879881b78c135d9 to your computer and use it in GitHub Desktop.
Save RaulMedeiros/66c7b265058c3aa44879881b78c135d9 to your computer and use it in GitHub Desktop.
import pandas as pd
x = pd.DataFrame()
isinstance(x, pd.DataFrame) and not x.empty
>>>False
x = None
isinstance(x, pd.DataFrame) and not x.empty
>>>False
x = pd.DataFrame([1,2,3])
isinstance(x, pd.DataFrame) and not x.empty
>>>True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment