smr1113's recent timeline updates
smr1113

smr1113

V2EX member #397809, joined on 2019-04-02 16:34:10 +08:00
smr1113's recent replies
Aug 8, 2019
Replied to a topic by 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]]
Aug 8, 2019
Replied to a topic by 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})
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4753 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 23ms · UTC 10:04 · PVG 18:04 · LAX 03:04 · JFK 06:04
♥ Do have faith in what you're doing.