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