The numpy.asscalar() function converts an array of size 1 to its scalar equivalent.

Syntax

Parameter

a: This parameter represents an input array of size 1.

Return

This function returns a scalar representation of parameter ‘a’. The output data type is the same type returned by the input’s item method.

Example 1

Output

Example 2

Output

Pin It on Pinterest

Share This