Discovered today that there’s no inbuilt nCr function in any of the popular Python modules. Tried itertools, numpy, sciPy This can’t be true? What am I missing? Seems odd to have write it out using math.factorial or use a helper function. Maybe I’m abnormally lazy.
Glad to have it confirmed, thanks. Yes, I was looking for the nCr number function.
-
-
it is surprising that it's not in the standard library. kinda goes against the "batteries included" design philosophy of Python to exclude it like this, even though its simple to implement it yourself.
-
Yeah, that’s why I asked publicly. I wondered if there were some less used mathy library I hadn’t come across yet. Easy enough to add it to my own modules, but just seemed odd.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.