- SciPy - Home
- SciPy - Introduction
- SciPy - Environment Setup
- SciPy - Basic Functionality
- SciPy - Relationship with NumPy
- SciPy Clusters
- SciPy - Clusters
- SciPy - Hierarchical Clustering
- SciPy - K-means Clustering
- SciPy - Distance Metrics
- SciPy Constants
- SciPy - Constants
- SciPy - Mathematical Constants
- SciPy - Physical Constants
- SciPy - Unit Conversion
- SciPy - Astronomical Constants
- SciPy - Fourier Transforms
- SciPy - FFTpack
- SciPy - Discrete Fourier Transform (DFT)
- SciPy - Fast Fourier Transform (FFT)
- SciPy Integration Equations
- SciPy - Integrate Module
- SciPy - Single Integration
- SciPy - Double Integration
- SciPy - Triple Integration
- SciPy - Multiple Integration
- SciPy Differential Equations
- SciPy - Differential Equations
- SciPy - Integration of Stochastic Differential Equations
- SciPy - Integration of Ordinary Differential Equations
- SciPy - Discontinuous Functions
- SciPy - Oscillatory Functions
- SciPy - Partial Differential Equations
- SciPy Interpolation
- SciPy - Interpolate
- SciPy - Linear 1-D Interpolation
- SciPy - Polynomial 1-D Interpolation
- SciPy - Spline 1-D Interpolation
- SciPy - Grid Data Multi-Dimensional Interpolation
- SciPy - RBF Multi-Dimensional Interpolation
- SciPy - Polynomial & Spline Interpolation
- SciPy Curve Fitting
- SciPy - Curve Fitting
- SciPy - Linear Curve Fitting
- SciPy - Non-Linear Curve Fitting
- SciPy - Input & Output
- SciPy - Input & Output
- SciPy - Reading & Writing Files
- SciPy - Working with Different File Formats
- SciPy - Efficient Data Storage with HDF5
- SciPy - Data Serialization
- SciPy Linear Algebra
- SciPy - Linalg
- SciPy - Matrix Creation & Basic Operations
- SciPy - Matrix LU Decomposition
- SciPy - Matrix QU Decomposition
- SciPy - Singular Value Decomposition
- SciPy - Cholesky Decomposition
- SciPy - Solving Linear Systems
- SciPy - Eigenvalues & Eigenvectors
- SciPy Image Processing
- SciPy - Ndimage
- SciPy - Reading & Writing Images
- SciPy - Image Transformation
- SciPy - Filtering & Edge Detection
- SciPy - Top Hat Filters
- SciPy - Morphological Filters
- SciPy - Low Pass Filters
- SciPy - High Pass Filters
- SciPy - Bilateral Filter
- SciPy - Median Filter
- SciPy - Non - Linear Filters in Image Processing
- SciPy - High Boost Filter
- SciPy - Laplacian Filter
- SciPy - Morphological Operations
- SciPy - Image Segmentation
- SciPy - Thresholding in Image Segmentation
- SciPy - Region-Based Segmentation
- SciPy - Connected Component Labeling
- SciPy Optimize
- SciPy - Optimize
- SciPy - Special Matrices & Functions
- SciPy - Unconstrained Optimization
- SciPy - Constrained Optimization
- SciPy - Matrix Norms
- SciPy - Sparse Matrix
- SciPy - Frobenius Norm
- SciPy - Spectral Norm
- SciPy Condition Numbers
- SciPy - Condition Numbers
- SciPy - Linear Least Squares
- SciPy - Non-Linear Least Squares
- SciPy - Finding Roots of Scalar Functions
- SciPy - Finding Roots of Multivariate Functions
- SciPy - Signal Processing
- SciPy - Signal Filtering & Smoothing
- SciPy - Short-Time Fourier Transform
- SciPy - Wavelet Transform
- SciPy - Continuous Wavelet Transform
- SciPy - Discrete Wavelet Transform
- SciPy - Wavelet Packet Transform
- SciPy - Multi-Resolution Analysis
- SciPy - Stationary Wavelet Transform
- SciPy - Statistical Functions
- SciPy - Stats
- SciPy - Descriptive Statistics
- SciPy - Continuous Probability Distributions
- SciPy - Discrete Probability Distributions
- SciPy - Statistical Tests & Inference
- SciPy - Generating Random Samples
- SciPy - Kaplan-Meier Estimator Survival Analysis
- SciPy - Cox Proportional Hazards Model Survival Analysis
- SciPy Spatial Data
- SciPy - Spatial
- SciPy - Special Functions
- SciPy - Special Package
- SciPy Advanced Topics
- SciPy - CSGraph
- SciPy - ODR
- SciPy Useful Resources
- SciPy - Reference
- SciPy - Quick Guide
- SciPy - Cheatsheet
- SciPy - Useful Resources
- SciPy - Discussion
SciPy - nu2lambda() Method
The SciPy nu2lambda() method is used to convert optical frequency into wavelength. Optical frequency is determined by the number of times a light wave vibrates within a given time period and the wavelength is defined by distance covered between two peaks of wave.
The wavelength and optical frequency are two numerical(shape) parameters which allows user to use lambda distribution. The process of this distribution refers to two different probabilities which is used in statistics.
You can understand this function by changing the type of value from one to another such as language switching, currency exchange, frequency to wavelength, etc. There are two probability distribution −
- Tukey's lambda distribution− This determines the statistical operation such as normal, exponential, or, gamma which is best describing of data analysis.
- Wilks lambda distribution− This determines the hypothesis testing. This type of testing is a part of statistics which uses sample data to draw conclusions.
Syntax
Following is the syntax of the SciPy nu2lambda() method −
nu2lambda(nu)
Parameters
This function accepts only a single parameter−
- nu: This is a numerical parameter either an integer or float.
Return value
This function returns the float or an array of float.
Example 1
Following is the basic SciPy program that shows the usage of nu2lambda() method.
import scipy.constants as const
# Frequency in Hz
freq = 5e14
# Convert frequency to wavelength
wave = const.nu2lambda(freq)
print(f"Frequency: {freq} Hz")
print(f"Wavelength: {wave} meters")
Output
On execution of above code, we get the following result −
Frequency: 500000000000000.0 Hz Wavelength: 5.99584916e-07 meters
Example 2
Here, we set the value of visible light(Hz) in which the value is accepted by nu2lambda() to get the result of frequency and wavelength.
import scipy.constants as const
# Frequency of visible light in Hz
freq = 5.5e14
# Convert frequency to wavelength
wave = const.nu2lambda(freq)
print(f"Frequency: {freq} Hz (green light)")
print(f"Wavelength: {wave} meters")
Output
After executing the above code, we get the following result −
Frequency: 550000000000000.0 Hz (green light) Wavelength: 5.450771963636364e-07 meters
Example 3
Below the example illustrates the convesion of frequency of microwave ovens into wavelength using nu2lambda() which print the result in meters.
import scipy.constants as const
# Frequency of microwaves in Hz
freq = 2.45e9
# Convert frequency to wavelength
wave = const.nu2lambda(freq)
print(f"Frequency: {freq} Hz (microwave oven)")
print(f"Wavelength: {wave} meters")
Output
The above code produces the following result −
Frequency: 2450000000.0 Hz (microwave oven) Wavelength: 0.12236426857142857 meters