0

I am a new learner in python and met the following error.
I want to find a particular index in an array; so I did

a=np.array([10,11,12,13,14])
a.index(3)

It shows 'np.adarray' object has no attribute 'index'

How to fix it? thanks!

1 Answer 1

2

Just use [...]:

a=np.array([10,11,12,13,14])
print(a[3])

Result:

13
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.