matthewgilbert / blp

Pythonic interface for Bloomberg Open API
Apache License 2.0
112 stars 24 forks source link

Question #19

Closed MC1892 closed 1 year ago

MC1892 commented 1 year ago

Code Sample, a copy-pastable example if possible

bbg_strings = list(df.bbgstring.unique()) mkt_px = list(df.mkt_price)

bquery = blp.BlpQuery().start()

for x, y in zip(bbg_strings, mkt_px): bquery.bdp(x,['YLD_CNV_BID'], overrides=['PX_BID'], y)

# Your code here, this should be a minimal reproducible example, see https://stackoverflow.com/help/mcve

Problem description

I am new to python and trying to figure out how to pass a list of fixed income securities to the query along with a list of the prices of those securities as overrides to calculate the yield of those securities. This code returns a value error: too many values to unpack.

Expected Output

a dataframe with the yields for the list of securities