ArcticDB icon indicating copy to clipboard operation
ArcticDB copied to clipboard

Add a way to return just the index of a symbol when its index has no name

Open aschonfeld opened this issue 1 year ago • 3 comments

Say we have a symbol which has a time series index with no name.

import pandas as pd

df = pd.DataFrame(dict(foo=[1,2,3], bar=[4,5,6]))
df = df.reindex([pd.Timestamp('20230101'), pd.Timestamp('20230102'), pd.Timestamp('20230103')])
df.index

It would be excellent if we can select that index using the columns parameter of the read function by doing something like the following:

lib.read('symbol', columns=['index'])

This would return: DatetimeIndex(['2023-01-01', '2023-01-02', '2023-01-03'], dtype='datetime64[ns]', freq=None)

aschonfeld avatar May 18 '23 12:05 aschonfeld

Rather than a special column name, index, perhaps a new arg, or an attribute on the returned object?

lib.read('symbol').index

jamesmunro avatar May 18 '23 12:05 jamesmunro

That would be great! Assuming the data will be lazy-loaded (meaning it doesn't load the entire dataframe just to pop off the index)

aschonfeld avatar May 18 '23 12:05 aschonfeld

ps a new arg, or an attri

this would be same as lib.read('symbol').data.index, won't benefit from col segment

Naich avatar May 24 '23 05:05 Naich

Resolved by #1568

vasil-pashov avatar Aug 02 '24 14:08 vasil-pashov