[PYTHON] Is there a special in scipy? ??

Overview

I want to find $ _4C_2 $ in python. It seems easy to do with scipy.special.comb, a library called scipy.

error

If you write as follows

import scipy
print(scipy.special.comb(4, 2))

error

AttributeError: module 'scipy' has no attribute 'special'

solution

It is OK to write as follows

from scipy.special import comb
print(comb(4, 2))

Execution result

6.0

The following is also possible

from scipy import special
print(special.comb(4, 2))

Summary

import scipy not from scipy.special import comb or from scipy import special

Recommended Posts

Is there a special in scipy? ??
There is no switch in python
Is there a bias in the numbers that appear in the Fibonacci numbers?
Hash in Perl is a dictionary in Python
Is there NaN in the pandas DataFrame?
There is Linux.
Is there a good sample code for nosetests?
Isn't there a default value in the dictionary?
If branch depending on whether there is a specific element in the list
What is a distribution?
Check if the string is a number in python
Implement a circular expression binary search in Python. There is a comparison with a simple full search.
What is a terminal?
VS Code says there is an error in cv2
What is a hacker?
dict in dict Makes a dict a dict
What is a pointer?
Explicitly writing a loop in numpy is extremely slow
When reading an image with SimpleITK, there is a problem if there is Japanese in the path
[python] Reverse with slices! !! (There is also a commentary on slices!)
Grayscale image is displayed as a color image in OpenCV / Python
Is there a secret to the frequency of pi numbers?
Take a screenshot in Python
Create a function in Python
Create a dictionary in Python
Collaborate in a remote environment
Handling sparse matrices in Scipy
Is this string a decimal?
Is this a system trade?
What is a decision tree?
Python list is not a list
Make a bookmarklet in Python
What is a Context Switch?
What is a super user?
What is a system call
[Definition] What is a framework?
Mathematical functions found in Scipy
Draw a heart in Python
This is a webiopi question
What is a callback function?
The image is a slug
What is a python map?
Python will fail if there is a space after the backslash
Play a sound in Python assuming that the keyboard is a piano keyboard
Unfortunately there is no sense of unity in the where method
Sequential processing method when there is not enough memory in Keras
Anyway, the fastest serial communication log is left in a file
[Python] Execution time when a function is entered in a dictionary value
Delete a particular character in Python if it is the last
A program that determines whether a number entered in Python is a prime number
[Ln] How to paste a symbolic link in a directory is complicated
[Free study] Is there a connection between Wikipedia updates and trends?
What's new in datetime that is a bit more useful in Python 3
[Golang] Check if a specific character string is included in the character string
Probability statistics in Pokemon (uncorrelated test) --Is there a correlation between CP, weight, and height of Magikarp?
Check if there is a specific symbol in the executable file and its dependent libraries (simplified version)