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

请问 python 里面有没一个函数或者方法可以直接计算一组向量的合向量?

  •  
  •   meteor2013 · Jun 23, 2016 · 3968 views
    This topic created in 3788 days ago, the information mentioned may be changed or developed.
    6 replies  •  2016-08-01 13:13:50 +08:00
    pimin
    pimin
    Jun 23, 2016
    1
    NumPy
    debiann
    debiann
    Jun 23, 2016 via iPhone
    2
    Geoion
    Geoion
    Jun 23, 2016 via Android
    3
    做数学怎么能不知道 scipy 呢?
    practicer
    practicer
    Jun 23, 2016
    4
    import numpy as np

    >>> np.sum([[0, 1], [0, 5]])
    6
    jinxueliu
    jinxueliu
    Jun 24, 2016
    5
    向量的计算还是用 Numpy 吧
    necomancer
    necomancer
    Aug 1, 2016
    6
    In [1]: import numpy as np

    In [2]: a = array([[1,2,3],[2,2,3]])
    ...:

    In [3]: np.sum(a, axis = 0)
    Out[3]: array([3, 4, 6])
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   5495 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 03:37 · PVG 11:37 · LAX 19:37 · JFK 22:37
    ♥ Do have faith in what you're doing.