Skip to content

Commit dd3fec7

Browse files
committed
implement math.comb ourselves
1 parent dfc5ea0 commit dd3fec7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/matplotlib/bezier.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@
99

1010
import matplotlib.cbook as cbook
1111

12-
_comb = np.vectorize(math.comb)
12+
# same algorithm as 3.8's math.comb
13+
def _comb(n, k):
14+
k = min(k, n - k)
15+
i = np.arange(1, k + 1)
16+
return np.prod((n + 1 - i)/i).astype(int)
17+
_comb = np.vectorize(_comb)
1318

1419
class NonIntersectingPathException(ValueError):
1520
pass

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy