0 points

python - Check if multiple columns exist in a df - Stack Overflow


dashboard

Wed Aug 12 2020 22:05:29 GMT+0000 (UTC)

Posted by @arielvol #python

 # single column:
 if `A` in df and `B` in df:
 
 
 # multiple columns:
 pd.Series(['A', 'B']).isin(df.columns).all()
content_copy Copy

https://stackoverflow.com/questions/47815140/check-if-multiple-columns-exist-in-a-df