Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
While converting the list to numpy array gives the error
AttributeError: 'numpy.int64' object has no attribute 'array"
Code:
d=np.array(list1)
np
import numpy
numpy .array
list1
As mentioned by @venky, check if you are using "np" as a variable somewhere. If not try the code below and see if you get an error. It should work
import numpy as np mylist = [1,2,3] a = np.array(mylist) type(a)
Add a comment
Required, but never shown
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.
Explore related questions
See similar questions with these tags.
npbeen assigned a value elsewhere in the code?np. Or tryimport numpythen usenumpy .arraylist1? isnpre-assigned?