You can find the variance in Python using NumPy with the following code. If you want to learn Python then I will highly recommend you to read This Book.

Variance
import numpy as np a = [1,2,3,4,5,6] x = np.var(a) print(x) #output 2.9166666666666665
Variance of NumPy Array
import numpy as np b = np.array([1,2,3,4,5,6]) y = np.var(b) print(y) #output 2.9166666666666665
People are also reading:
What is Computer Vision? Examples, Applications, Techniques
Top 10 Computer Vision Books with Python
Books for Machine Learning (ML)