import pandas as pdimport numpy as npimport mathdf=pd.read_excel('波动率数据.xlsx')jz=df["净值"]xh=df["序号"]product=1i=1j=0k=0result1=0for i in jz: product*=iaveragelogproduct=np.log(product)/len(jz)for j in xh: result=np.square(np.l...import pandas as pdimport numpy as npimport mathdf=pd.read_excel('波动率数据.xlsx')jz=df["净值"]xh=df["序号"]product=1i=1j=0k=0result1=0for i in jz: product*=iaveragelogproduct=np.log(product)/len(jz)for j in xh: result=np.square(np.log(jz[j]/jz[j+1]) - averagelogproduct) result1+=result print(result1)