-1

I am trying to input a matix using numpy and I get the following error:

Traceback (most recent call last):
  File "phase1.py", line 1, in <module>
    import numpy as np 
  File "/home/rockstar/phase1.py", line 2, in <module>
    a= np.array([1,2,3])
AttributeError: 'module' object has no attribute 'array'

I am not sure why this error is there. Could anyone help?

1

1 Answer 1

3

You probably have a file called numpy.py in the same folder that shadows the real numpy module. Rename your .py file and delete its .pyc file.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.