smr1113's recent timeline updates
smr1113

smr1113

V2EX member #397809, joined on 2019-04-02 16:34:10 +08:00
  •   The specified image does not exist
    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   ·   1473 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 12ms · UTC 16:48 · PVG 00:48 · LAX 09:48 · JFK 12:48
    ♥ Do have faith in what you're doing.