ysmoothed = gaussian_filter1d(data, sigma=5)
x = [i for i in range(len(ysmoothed))]
y = [0.5 for i in range(len(ysmoothed))]
plt.plot(x, ysmoothed, 'b-', x, y, 'r-')
plt.show()
и получается картинка
Как сделать часть кривой, которая выше прямой y = 0.5 другим цветом?
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm 2018.1.3\helpers\pydev\pydev_run_in_console.py", line 52, in run_file
pydev_imports.execfile(file, globals, locals) # execute the script
File "C:\Program Files\JetBrains\PyCharm 2018.1.3\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "C:/Users/milssky/PycharmProjects/hrm/hrm.py", line 102, in <module>
if y > 0.5:
TypeError: '>' not supported between instances of 'list' and 'float'