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

Python |图中这样的数据怎么高效存取

  •  
  •   stonesirsir · Nov 4, 2023 · 1834 views
    This topic created in 924 days ago, the information mentioned may be changed or developed.

    图中这样的数据怎么高效存取,后续可能对每一个节点进行验证,怎么方便的存取呢?

    语言不限,烦请各位大佬指点

    4 replies    2023-11-08 19:52:27 +08:00
    customsshen
        1
    customsshen  
       Nov 4, 2023
    列表推导式
    stonesirsir
        2
    stonesirsir  
    OP
       Nov 4, 2023
    @customsshen 兄弟能举个例子吗?我想存进 redis 或者数据库
    misoomang
        3
    misoomang  
       Nov 7, 2023
    https://docs.celeryq.dev/en/stable/userguide/canvas.html#chords

    菜鸟一枚,方案不夕勿喷,个人觉得可以采用 celery chord 的方式进行处理,它会等待所有的子任务处理完毕以后触发回调的方法

    子任务可以做字段选择和字段去重工作,大致思路是这样
    result1 = chord(处理数据源 1 ,处理数据源 2)(记录连接 1 方法)
    result2 = chord(处理数据源 3 ,处理数据源 4)(记录连接 2 方法)
    reslut3 = chord(result1, result2)
    stonesirsir
        4
    stonesirsir  
    OP
       Nov 8, 2023 via Android
    @misoomang 感谢兄弟,我看看
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2806 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 11:17 · PVG 19:17 · LAX 04:17 · JFK 07:17
    ♥ Do have faith in what you're doing.