I have a dataframe, "df_ytm", which is indexed by time series and has a header which is a list of bonds ("UKT 1.75 7 19","UKT 3.75 9 19" etc.)
, the data contains values for the bond on each day.
I have also created a dataframe of custom securities in "df_fly" that has custom names and columns for "left","centre", and "right". The data here contains the individual securities that make up the custom security.
df_ytm
df_fly
Question:
how can I create a new dataframe "df_fts" which is the time series of the individual flys names (with these names as the column headers) in the df_fly["name"], the data for this custom securities time-series should be created by a formula: ((2*centre)-(right+left))
Sorry if there is any confusion here - please let me know if you require more details. Thanks for any help
Mock up df_fts with dummy data
I have previously tried creating a new dataframe by copying the df_ytm and adding the new combinations and deleting the old bonds, but this didn't work.