pandas.DataFrame.columns#

DataFrame.columns#

The column labels of the DataFrame.

See also

DataFrame.index

The index (row labels) of the DataFrame.

DataFrame.axes

Return a list representing the axes of the DataFrame.

Examples

>>> df = pd.DataFrame({'A': [1, 2], 'B': [3, 4]})
>>> df
     A  B
0    1  3
1    2  4
>>> df.columns
Index(['A', 'B'], dtype='object')