During prolonged operation of the magnetic-array-type current sensor, environmental factors such as temperature cause measurement error drift in some magnetic field sensing units, thus degrading measurement accuracy. To address this issue, this paper proposes a data-driven self-correction method of errors for magnetic-array-type current sensors, utilizing principal component analysis (PCA) to develop a data-driven model from magnetic field measurement data. By identifying magnetic field sensing units with abnormal error drift and compensating their respective drift values, the method achieves self-correction of magnetic field sensor errors, thereby ensuring the long-term measurement accuracy of magnetic-array-type current sensors. Experimental results verify that the proposed method can effectively identify magnetic field sensing units experiencing error drift, and the original current measurement error drift of ±0.05 A can be reduced to ±0.02 A after error drift correction.