推荐学习书目
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 · 3727 views
    This topic created in 3641 days ago, the information mentioned may be changed or developed.
    6 replies    2016-08-01 13:13:50 +08:00
    pimin
        1
    pimin  
       Jun 23, 2016
    NumPy
    debiann
        2
    debiann  
       Jun 23, 2016 via iPhone
    Geoion
        3
    Geoion  
       Jun 23, 2016 via Android
    做数学怎么能不知道 scipy 呢?
    practicer
        4
    practicer  
       Jun 23, 2016
    import numpy as np

    >>> np.sum([[0, 1], [0, 5]])
    6
    jinxueliu
        5
    jinxueliu  
       Jun 24, 2016
    向量的计算还是用 Numpy 吧
    necomancer
        6
    necomancer  
       Aug 1, 2016
    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   ·   Solana   ·   3887 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 05:12 · PVG 13:12 · LAX 22:12 · JFK 01:12
    ♥ Do have faith in what you're doing.