有时候需要在绘制曲线的时候,绘制一条趋势线,如下图,这种如何实现呢,请看下文。
数据如下
趋势计算代码
有两个输入
第一个输入是一个待平滑的数值数组,
第二个输入是权重,越大越平滑
# weight between 0 and 1, the larger the smoother
# scalars is the input list
def smooth(scalars, weight):
last = scalars[
有时候需要在绘制曲线的时候,绘制一条趋势线,如下图,这种如何实现呢,请看下文。
有两个输入
第一个输入是一个待平滑的数值数组,
第二个输入是权重,越大越平滑
# weight between 0 and 1, the larger the smoother
# scalars is the input list
def smooth(scalars, weight):
last = scalars[
道可道,非常道;名可名,非常名。 无名,天地之始,有名,万物之母。 故常无欲,以观其妙,常有欲,以观其徼。 此两者,同出而异名,同谓之玄,玄之又玄,众妙之门。