data manipulation/ indexing python vs R
<p>I am inexperienced with python and am unsure what i should search for this particular task. I am trying to find a way to index a list much like i would index a vector in R:</p>

<h1>R</h1>

<pre><code>vec=c(1,2,3)

&gt; vec==1

[1]  TRUE FALSE FALSE
</code></pre>

<h1>python</h1>

<pre><code>&gt;&gt;&gt; list_a=[1,2,3]
&gt;&gt;&gt; list_a==1
False
</code></pre>

<h1>separate attempt in python</h1>

<pre><code>for i in list_a:
...     i==1
... 
False
False
False
</code></pre>

<p>Notice above that it is False for all three values even though the first value is 1???</p>

<h1>And yet</h1>

<pre><code>&gt;&gt;&gt; for i in list_a:
...     if i==1:
...             print('hello')
... 
hello
</code></pre>

<p>Hence when it comes to python I am just looking for a way to index the the python list in the same way as i can I'm R???</p>

<p>an alternative:</p>

<pre><code>map(lambda x: x == 1, list_a)
#[True, False, False]
</code></pre>

python