def checkio(*args):
import numpy as np
x = args
if x !=():
x = np.array(x).astype('float32') # I tried others type e.g., int32 float64 int64
if np.shape(x[0]) != ():
x = x[0]
x_max = np.max(x)
x_min = np.min(x)
result = x_max - x_min
return result
else:
return 0
I wrote this function for the question.I ran it without any problems.
It hints me
'/home/site/checkio/runners/py32.py:255: DeprecationWarning: cgi.escape is deprecated, use html.escape instead, error = u'TypeError: {0} is wrong data type'.format(cgi.escape(str(type(result)))),TypeError: <class 'numpy.float32'> is wrong data type.' when I checked it.
Which data type can I choose, if I want to use numpy?
Please help me, thanks.
Btw, sorry for my bad english.
Created at: 2019/04/22 20:57; Updated at: 2019/04/23 12:45
The question is resolved.