Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Python
  3. Question
Python

Is there an R function for finding the index of an element in a vector?

Asked by Dylan Powell May 17, 2021 631 views 1 answer
Share

About this question

Is there any shortcut method to find an index of an element in a vector, I have an element Q with me and a vector W and now I want to look out foe first index of an element Q which is equal to W, currently I am using which(Q == W)[[1]]  but this is not sufficient I think. 

Can someone answer this doubt?

Your answer

1 Answer

More Python discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Python Blogs

Guides, tips and career advice on Python from JanBask experts.