推荐学习书目
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 · 3653 views
    This topic created in 2992 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   ·   Solana   ·   5433 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 06:53 · PVG 14:53 · LAX 23:53 · JFK 02:53
    ♥ Do have faith in what you're doing.