For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
20 1 2 2

How to rename the column header in the data frame?

Hi, in using eikon.get_data() to extract SmartEstimate data into python dataframes, I get "Earnings Per Share - SmartEstimate®" but cannot rename the header given the "®". How do I rename the column header in this case?

eikoneikon-data-apipythonworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpandas
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
Accepted
4.6k 26 7 22

This should work

df = df.rename(columns={'Instrument': 'Test', 'Earnings Per Share - SmartEstimate®': 'Test2'})

screen-shot-2017-09-26-at-105329.png


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
20 1 2 2

thanks. somehow, it now works when it didn't earlier.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.