Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example Code Fails #2

Closed
emanual4real opened this issue May 10, 2017 · 2 comments
Closed

Example Code Fails #2

emanual4real opened this issue May 10, 2017 · 2 comments

Comments

@emanual4real
Copy link

I'm fairly new to Python and tried to use your Vector package. I'm a fan of linear algebra. I can't seem to get your examples to work though.


v1 = Vector(1, 2, 3)

print(v1.magnitude())

Yields the below error. I'm on Python 3.6

  File "C:\Python36-32\lib\site-packages\vectors\vectors.py", line 52, in magnitude
    return (math.sqrt(reduce(lambda x, y: x+y,
NameError: name 'reduce' is not defined

Thanks
Manny

@barbaBus
Copy link

The issue is that the "reduce" has been moved into functools library.
It is just necessary to add in the file vectors.py the following import command at the beginning:

from functools import reduce

@allelos allelos closed this as completed Jul 31, 2017
@manan3172003
Copy link

I cannot use sum, dot product, cross product and many other functions.
error: TypeError: 'list' object is not callable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants