Upgrade from Eikon -> Workspace. Learn about programming differences.

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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
20 2 3 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-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-apipandas
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.

@CT1309


Thank you for your participation in the forum.

Is the reply below satisfactory in resolving your query? If yes please click the 'Accept' text next to the most appropriate reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.

Thanks,

-AHS

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 2 3 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.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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