The electro-optical coefficient is an important parameter of lithium niobate crystal,which is closely related to the design and application of electro-optical devices.However,the synthesis conditions of lithium nio-bate crystals are different and this results in different electro-optical coefficients of each crystal,which brings diffi-culties to the error analysis of electro-optical coefficients.From the perspective of numerical analysis,Python,the open source package is used to fit the measured data.The specific value of fitting parameters and their uncertainties are obtained,and then the electro-optical coefficient of crystal is derived from the error transfer theory.Numerical analysis shows that the half-wave voltage method has high accuracy in measuring electro-optic coefficient,and its relative error is less than 2%.The fitting code of the widely used program Python is also given in this paper,and relevant researchers are welcome to use for reference.