I am trying to plot fx vol surf using the file I found on Git Hub in below link.
https://github.com/Refinitiv-API-Samples/Article.RDPLibrary.Python.VolatilitySurfaces_Curves
File name "Vol Surfaces Webinar.ipynb". It worked for ETI option but for FX Volatility Surface, it returned error. Vol Surfaces Webinar.zip
--------------------------------------------------------
fx_surfaces = fx_response.data.raw['data']
plot_surface(fx_surfaces, 'FxVol-USDSGD', True)
--------------------------------------------------------
TypeError Traceback (most recent call last) <ipython-input-23-1b085c0e4326> in <module> 1 fx_surfaces = fx_response.data.raw['data'] ----> 2 plot_surface(fx_surfaces, 'FxVol-USDSGD', True) <ipython-input-5-0e89ac2f0bf9> in plot_surface(surfaces, surfaceTag, delta_plot) 26 # When plotting FX Delta rather than Strike 27 # I'm converting the x axis value from Delta to Put Delta ---> 28 delta_axis = list(map(convert_delta, strike_axis)) 29 x = np.array(delta_axis, dtype=float) 30 else: <ipython-input-5-10b94499ab72> in convert_delta(delta) 1 def convert_delta(delta): ----> 2 if (delta<0): 3 return -delta 4 elif (delta>0): 5 return 1-delta TypeError: '<' not supported between instances of 'str' and 'int'