V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
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
bleutail
V2EX  ›  Python

如何用 pandas 实现最近一段时间成交量的百分位分类

  •  
  •   bleutail · Jun 15, 2022 · 2413 views
    This topic created in 1417 days ago, the information mentioned may be changed or developed.

    比如一个顺序时间索引的价格-成交量表,把每一行的成交量换为该行在最近一百行或者一固定时间段的全部成交量中所属的百分位? 因为把成交量换为百分位后应该可以极大提高数据用于机器学习的泛化能力,比如最后两次成交量为 99 手-49 手,98 手-50 手,可以统一转化为 0.85-0.25 是否还有其他更好的办法呢?

    3 replies    2022-06-18 22:24:30 +08:00
    victorc
        1
    victorc  
       Jun 15, 2022
    这是一个非常简单的编程问题,你遍历每行,把成交量收集到一个 list 里面,按 10%递进,算一个 1-100 的百分位数据表,然后再遍历 1 次,用 vol 查出分位数,遍历两次就够了
    ipwx
        2
    ipwx  
       Jun 15, 2022   ❤️ 1
    LeeReamond
        3
    LeeReamond  
       Jun 18, 2022
    LZ 这水平出来炼丹不怕炸炉吗。。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2538 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 281ms · UTC 08:54 · PVG 16:54 · LAX 01:54 · JFK 04:54
    ♥ Do have faith in what you're doing.