Chi square distribution for feature selection
There are different ways for feature selection. A very good read in machinelearningmastery, to recap:


Univariate Selection.
Recursive Feature Elimination.
Principal Component Analysis.
Feature Importance.


Chi-Squared test For Feature Selection goes under the Univariate Selection method for non-negative features. My favorite explanation of chi-Squared in one photo taken from this blogpost is:


As you can see scikit-learn has an implementation for feature_selection using chi2 (perhaps according to scipy.stats.chisquare) as was shown very briefly in the above-mentioned blog post. 

If you want a more thorough explanation and details how test ranks features based on statistics according to chi2 distribution and p-value etc., and also how to build your own chi2 class for feature selection in Python see this great post. Obviously one can read about the basics of chi2 distribution and test in wikipedia.