I feel question deserves additional explanation.
As @fixxxer noted, the answer depends on the pandas version you are using in your project.
Which you can get with pd.__version__
command.
If you are for some reason like me (on debian jessie I use 0.14.1) using older version of pandas than 0.16.0, then you need to use:
df.keys().tolist()
because there is no df.columns
method implemented yet.
The advantage of this keys method is, that it works even in newer version of pandas, so it's more universal.