title: how to understand few symbols and syntaxs in Julia?
body: <p>I am very new to Julia language, so I started to read the documentation and all built-in functions. Now, I am learning one github project for my work. Since I am more comfortable with Python, I tried to translate Julia's code to python by my understanding, but I got a few weird syntaxes that I didn't understand and I got stuck with them. Can anyone point me out the meaning of those syntaxes? Thanks in advance!</p>
  <p><strong>syntax that I don't understand</strong></p>
  <p>those julia code line that I didn't understand because I didn't find them either in documentations.</p>
  <p><code>var1 = Tuple{Integer, Vector}[]</code></p>
  <p>here we declare object var 1, what's a real example for that? what's the python version?</p>
  <p>also if <code>X::Matrix, n::Int</code>, then what's the meaning of <code>?</code> in the below? How should I code this in python?</p>
  <p><code>K = [( i &gt;= j ? dot(view(X,:,i), view(X,:,j)) : 0.0 )::Float64 for i=1:n, j=1:n]</code></p>
  <p>how should we code up this in python?</p>
  <p>Also, I am not sure about meaning of <code>-&gt;</code> in below:</p>
  <pre><code>for i=1:n 
        id_i = find(x -&gt; x[1] == i, var1)
        xi_i_list =  map(x -&gt; x[2], var1[id_i])
  
  how should we translate this into python?
  
  </code></pre>
  <p>lastly, I just don't understand the meaning of <code>.&gt;</code> in below:</p>
  <pre><code>act= zeros(100)
  alpha = zeros(10)
  
    for i=1:100
      idx = find(x::Tuple{Integer, Vector} -&gt; x[1] == i, var1)
      act[i] = sum(alpha[idx] .&gt; 1e-3)
  </code></pre>
  <p>As a newbie, I am trying to understand the role of <code>find()</code>, <code>map()</code>. To the best, I wish I could write the above Julia code with Python. But I have a hard time understanding the code. Can anyone give possible interpretations and corresponding python codes for learning purposes? Thanks in advance!</p>