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...<br>", arr)

Get the type of the array −

print("\nOur Array type...<br>", arr.dtype)

Get the dimensions of the Array −

print("\nOur Array Dimension...<br>",arr.ndim)

Get the shape of the Array −

print("\nOur Array Shape...<br>",arr.shape)

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

print("Array...<br>", 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...<br>", arr)

# Get the type of the array
print("\nOur Array type...<br>", arr.dtype)

# Get the dimensions of the Array
print("\nOur Array Dimension...<br>",arr.ndim)

# Get the shape of the Array
print("\nOur Array Shape...<br>",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...<br>", 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: 2022-02-28T09:19:16+05:30

319 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements