import pandas import numpy def get_circle_area(l,h): r=numpy.sqrt(l**2+h**2)/2 return r**2*numpy.pi excel=pandas.read_excel('长方形.xlsx',index_col='id') excel['ca']=excel.apply(lambda row:get_circle_area(row['length'],row['width']),axis=1) print(excel)