ArcticDB
ArcticDB copied to clipboard
Add a way to return just the index of a symbol when its index has no name
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)
Rather than a special column name, index
, perhaps a new arg, or an attribute on the returned object?
lib.read('symbol').index
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)
ps a new arg, or an attri
this would be same as lib.read('symbol').data.index
, won't benefit from col segment
Resolved by #1568