推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
jxylon
V2EX  ›  Python

萌新~~~Dataframe 如何实现将第 n+1 行各列的值减去第 n 行,结果赋于第 n 行

  •  
  •   jxylon · Mar 12, 2018 · 3980 views
    This topic created in 3120 days ago, the information mentioned may be changed or developed.
    Dataframe 如何实现将第 n+1 行各列的值减去第 n 行,结果赋于第 n 行
    3 replies  •  2018-03-12 18:13:25 +08:00
    kifile
        1
    kifile  
       Mar 12, 2018
    df.iloc[n,:]-=df.iloc[n+1,:]
    kifile
        2
    kifile  
       Mar 12, 2018
    貌似写反了
    df.iloc[n,:]=df.iloc[n+1,:]-df.iloc[n,:]
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2590 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 12:24 · PVG 20:24 · LAX 05:24 · JFK 08:24
    ♥ Do have faith in what you're doing.