- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

# How can SciPy be used to calculate the permutations and combination values in Python?

SciPy can be used to determine the permutation and combination with respect to two values.

A function named ‘perm’ present in the class ‘special’ in ‘SciPy’ is used.

**Syntax of ‘perm’ function**

scipy.special.perm(N, k)

**Performing permutation on a set of values has been shown below**

## Example

from scipy.special import perm my_permute = perm(6, 2, exact = True) print("The permutation of 6 and 2 is ") print(my_permute)

## Output

The permutation of 6 and 2 is 30

## Explanation

- The required libraries are imported.
- Parameters are passed to the ‘perm’ function that computes the value.
- The value is assigned to a variable.
- This variable is displayed on the console.

## Computing combination of two values in SciPy

A function named ‘comb’ present in the class ‘special’ in ‘SciPy’ is used.

**Syntax of ‘comb’ function**

scipy.special.comb(N, k)

**Performing permutation on a set of values has been shown below**

## Example

from scipy.special import comb my_comb = comb(6, 2, exact = True) print("The combination of 6 and 2 is ") print(my_comb)

## Output

The combination of 6 and 2 is 15

## Explanation

- The required libraries are imported.
- Parameters are passed to the ‘comb’ function that computes the value.
- The value is assigned to a variable.
- This variable is displayed on the console.

- Related Articles
- How can SciPy be used to calculate the cube root of values and exponential values in Python?
- How can SciPy be used to calculate the eigen values and eigen vectors of a matrix in Python?
- How can SciPy be used to calculate the inverse of a matrix in Python?
- How can SciPy be used to calculate the determinant value of a matrix in Python?
- How can discrete Fourier transform be performed in SciPy Python?
- What is SciPy in Python? Explain how it can be installed, and its applications?
- Explain how Nelder-Mead algorithm can be implemented using SciPy Python?
- How to calculate combination and permutation in C++?
- How can Tensorflow and Python be used to verify the CIFAR dataset?
- Explain how the minimum of a scalar function can be found in SciPy using Python?
- How can Tensorflow and Python be used to download and prepare the CIFAR dataset?
- How can Keras be used to save and serialize the model using Python?
- How can Tensorflow be used to compile and fit the model using Python?
- How can SELECT, without reference to any table, be used to calculate expression in MySQL?
- How can Keras be used to implement ensembling in Python?

Advertisements