bigframes.pandas.DataFrame.columns#
- propertyDataFrame.columns:Index#
The column labels of the DataFrame.
Examples:
You can access the column labels of a DataFrame via
columnsproperty.>>>df=bpd.DataFrame({'Name':['Alice','Bob','Aritra'],...'Age':[25,30,35],...'Location':['Seattle','New York','Kona']},...index=([10,20,30]))>>>df Name Age Location10 Alice 25 Seattle20 Bob 30 New York30 Aritra 35 Kona[3 rows x 3 columns]>>>df.columnsIndex(['Name', 'Age', 'Location'], dtype='object')
You can also set new labels for columns.
>>>df.columns=["NewName","NewAge","NewLocation"]>>>df NewName NewAge NewLocation10 Alice 25 Seattle20 Bob 30 New York30 Aritra 35 Kona[3 rows x 3 columns]>>>df.columnsIndex(['NewName', 'NewAge', 'NewLocation'], dtype='object')
On this page