Skip to main content
Closed

Python SDK: Retrrieve dataframe with specified column header

Related products:API and SDKs
  • November 21, 2025
  • 2 replies
  • 43 views

Forum|alt.badge.img+2

Hi,

When retrieving datapoints in a Pandas dataframe through the Python SDK using the retrieve_dataframe() method the external_id of the timeseries is set as the resulting column header. The external_id is not very readable, and it would be nice if we could specifiy which attribute to be used as column header

 

If there was a parameter in the function called e.g. use_timeseries_name [boolean] we could set the name of the timeseries as column header rather than external ID. This is more readable 

 

 

2 replies

Que Tran
Practitioner ⭐️⭐️⭐️
Forum|alt.badge.img
  • Practitioner ⭐️⭐️⭐️
  • November 25, 2025

Hi ​@Jørgen Aarstad ,

Thank you for the request! I’ve passed it along to the relevant team. We’ll follow up as soon as there’s news.

Best regards,
Que Tran


Forum|alt.badge.img
  • Practitioner ⭐️⭐️⭐️
  • March 10, 2026

Thank you for taking the time to share this feature idea!

After looking into it, we believe that wrapping the Pandas API for DataFrame.rename(...) falls outside the scope of the SDK. Pandas natively handles this with a high degree of flexibility, and trying to replicate that behavior by adding a new parameter to the method would be unnecessarily cumbersome to maintain and use.

You can already easily achieve your desired result by chaining the Pandas .rename() method directly to the retrieved dataframe.

Here is a quick example of how you can do this:

df = client.time_series.data.retrieve_dataframe(
external_id=["foo", "bar"], limit=5
).rename(
columns={"foo": "something", "bar": "else"}
)

To map the name attribute directly:

ts_xids = ['ts-test-123', 'ts-test-234', 'ts-test-345']
tss = client.time_series.retrieve_multiple(external_ids=ts_xids)
df = client.time_series.data.retrieve_dataframe(
external_id=ts_xids, limit=5
).rename(columns={ts.external_id: ts.name for ts in tss})