smr1113 最近的时间轴更新
smr1113

smr1113

V2EX 第 397809 号会员,加入于 2019-04-02 16:34:10 +08:00
smr1113 最近回复了
2019-08-08 17:34:25 +08:00
回复了 oldbird 创建的主题 Python 请教 Python 怎么进行列表的插值?
看错了~~
python:
from itertools import chain
list(chain(*zip(x, [(i+j)/2.0 for i,j in zip(x,x[1:])]))) + [x[-1]]
2019-08-08 17:23:44 +08:00
回复了 oldbird 创建的主题 Python 请教 Python 怎么进行列表的插值?
python:[x[0]] + [(i+j)/2.0 for i,j in zip(x,x[1:])]
函数式:
x.head :: (x zip x.tail map {case (x,y) => (x+y)/2.0})
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   908 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 12ms · UTC 20:58 · PVG 04:58 · LAX 13:58 · JFK 16:58
Developed with CodeLauncher
♥ Do have faith in what you're doing.