Confused what I do wrong any help helps I trying to understand numpy and learn it [1]: https://i.stack.imgur.com/QqPAw.png
import numpy as np
jeff_salary = [3300,2700,9000,2900]
base_salary = np.array([jeff_salary])
print(base_salary)
Confused what I do wrong any help helps I trying to understand numpy and learn it [1]: https://i.stack.imgur.com/QqPAw.png
import numpy as np
jeff_salary = [3300,2700,9000,2900]
base_salary = np.array([jeff_salary])
print(base_salary)
Your file has a name numpy.py
.
The line import numpy as np
doesn't import numpy. Instead - it imports itself! (your own script). And of course, your module doesn't have an attribute array
.
Rename your script, for example to: learning_numpy.py
, and it should work.
You had a hint in the error message:
AttributeError: partially initialized module 'numpy' has no attribute 'array' (most likely due to a circular import).