推荐学习书目
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
Fiery123
V2EX  ›  Python

pandas 的问题

  •  
  •   Fiery123 · Nov 15, 2018 · 2786 views
    This topic created in 2736 days ago, the information mentioned may be changed or developed.
    数据我整理成后。 用 test.query('user_id == 2') 取出一块数据。求问怎么根据 user_id 循环取出数据块?
    文档实在没找到例子:
    702 ETH 33609 1.20886643
    USD 33607 1.08208923
    703 DOGE 2872 468.76933700
    ETC 2994 1.05466548
    USD 2992 0.25246053
    XRP 2991 1.06401275
    ....

    balance
    user_id asset
    2 BCH 381 0.00000000
    BTC 386 0.16358623
    ETH 384 0.00000000
    LTC 362 0.00000060
    USD 125 0.20139664
    3 replies    2018-11-16 10:33:07 +08:00
    szzhiyang
        1
    szzhiyang  
       Nov 15, 2018
    ruoyu0088
        2
    ruoyu0088  
       Nov 15, 2018
    这个数据有的 4 列,有的 3 列,不是 Pandas 能够处理的数据格式。建议直接用循环一行一行地处理吧。
    qcts33
        3
    qcts33  
       Nov 16, 2018
    没太看明白你给的数据格式,但是 groupby 了解一下
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5529 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 08:24 · PVG 16:24 · LAX 01:24 · JFK 04:24
    ♥ Do have faith in what you're doing.