two methods have been suggested:
1: as shown in the sweep object, you can always use mean operation for all the sweep.
2: you can use getsweepresult.
in the getsweepresult page, you can learn some exmaples. For more informaiton, please refer to
https://optics.ansys.com/hc/en-us/categories/360001998954-Scripting-Language
you can watch vidoes, and learn each script command.
Please try to write script. if there is an error and you cannot fix it, please write a separate post.