numpy combinations math code example
Example 1: python nCr n choose r function
# Basic syntax:
from math import comb
comb(n, r) # calculates "n choose r" aka nCr aka binomial coefficients
Example 2: python choose function
>>> from math import comb
>>> comb(20,10)