The Pandas dataframe.keys()
function returns the "information axis" for a Pandas object. If the pandas object is sequential, then it returns the index. If the pandas object is a dataframe it will return columns. If the pandas object is a pane, it returns major_axis.
Syntax: DataFrame.keys ()
To link to the CSV file, click here
Example # 1: Use the keys ()
function to find columns of data.
|
|
Output:
Example # 2: Use the keys ()
function to find the index of a series pandas object.
|
|