Return the modified Bessel function evaluated at each of the elements of x in Python


To return the modified Bessel function evaluated at each of the elements of x, use the numpy.io() method. The parameter x is an Argument of the Bessel function. The method returns the modified Bessel function evaluated at each of the elements of x.

Steps

At first, import the required libraries −

import numpy as np

Create an array using the array() method −

arr = np.array([10, 20, 30, 40, 50])

Display the array −

print("Array...
", arr)

Get the type of the array −

print("
Our Array type...
", arr.dtype)

Get the dimensions of the Array −

print("
Our Array Dimension...
",arr.ndim)

Get the shape of the Array −

print("
Our Array Shape...
",arr.shape)

To return the modified Bessel function evaluated at each of the elements of x, use the numpy.io() method −

print("Array...
", np.i0(arr))

Example

import numpy as np

# Create an array using the array() method
arr = np.array([10, 20, 30, 40, 50])

# Display the array
print("Array...
", arr) # Get the type of the array print("
Our Array type...
", arr.dtype) # Get the dimensions of the Array print("
Our Array Dimension...
",arr.ndim) # Get the shape of the Array print("
Our Array Shape...
",arr.shape) # To return the modified Bessel function evaluated at each of the elements of x, use the numpy.io() method # The parameter x is an Argument of the Bessel function. # The method returns the modified Bessel function evaluated at each of the elements of x. print("Array...
", np.i0(arr))

Output

Array...
[10 20 30 40 50]

Our Array type...
int64

Our Array Dimension...
1

Our Array Shape...
(5,)
Array...
[2.81571663e+03 4.35582826e+07 7.81672298e+11 1.48947748e+16
2.93255378e+20]

Updated on: 28-Feb-2022

181 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements