gs_quant.markets.index.Index.get_constituents_for_date¶
- Index.get_constituents_for_date(date=datetime.date(2023, 8, 14))[source]¶
Fetch the constituents of the index in a pandas dataframe for a the given date.
- Return type:
DataFrame
- Returns:
pandas dataframe with the index constituents, weights and other details.
Usage
Get the constituents of the index for the given date
Examples
Get index constituents:
>>> import datetime as dt >>> from gs_quant.markets.index import Index >>> >>> index = Index.get("GSMBXXXX") >>> index.get_constituents_for_date(dt.date(2021, 7, 1))