Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Replace scipy.special.comb with math.comb (#4598)

F. Muenkel95047579181d
diff --git a/manim/utils/simple_functions.py b/manim/utils/simple_functions.py
index 792b7764d..317ea9ba4 100644
--- a/manim/utils/simple_functions.py
+++ b/manim/utils/simple_functions.py
@@ -9,13 +9,12 @@ __all__ = [
"sigmoid",
]
-
+import math
from collections.abc import Callable
from functools import lru_cache
from typing import Any, Protocol, TypeVar
import numpy as np
-from scipy import special
def binary_search(
@@ -87,9 +86,9 @@ def choose(n: int, k: int) -> int:
References
----------
- https://en.wikipedia.org/wiki/Combination
- - https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.comb.html
+ - https://docs.python.org/3/library/math.html#math.comb
"""
- value: int = special.comb(n, k, exact=True)
+ value: int = math.comb(n, k)
return value