<h2id="Default-parameters-of-functions">Default parameters of functions<aclass="anchor-link"href="#Default-parameters-of-functions">¶</a></h2><divclass="highlight"><pre><span></span><spanclass="k">def</span><spanclass="nf">foo</span><spanclass="p">(</span><spanclass="n">a</span><spanclass="p">,</span><spanclass="n">b</span><spanclass="o">=</span><spanclass="mi">1</span><spanclass="p">):</span>
<h2id="Creating--multi-dimentional-array-from-list/tuple">Creating multi-dimentional array from list/tuple<aclass="anchor-link"href="#Creating--multi-dimentional-array-from-list/tuple">¶</a></h2><divclass="highlight"><pre><span></span><spanclass="n">l</span><spanclass="o">=</span><spanclass="p">[[</span><spanclass="mi">1</span><spanclass="p">,</span><spanclass="mi">2</span><spanclass="p">,</span><spanclass="mi">3</span><spanclass="p">],[</span><spanclass="mi">4</span><spanclass="p">,</span><spanclass="mi">5</span><spanclass="p">,</span><spanclass="mi">6</span><spanclass="p">],[</span><spanclass="mi">7</span><spanclass="p">,</span><spanclass="mi">8</span><spanclass="p">,</span><spanclass="mi">9</span><spanclass="p">]]</span>
<h2id="Creating-special-matrix">Creating special matrix<aclass="anchor-link"href="#Creating-special-matrix">¶</a></h2><divclass="highlight"><pre><span></span><spanclass="c1"># Identity matrix</span>
<divclass="highlight"><pre><span></span><spanclass="n">m</span><spanclass="p">[</span><spanclass="mi">2</span><spanclass="p">]</span><spanclass="c1"># access index 2</span>
<spanclass="n">m</span><spanclass="p">[</span><spanclass="o">-</span><spanclass="mi">1</span><spanclass="p">]</span><spanclass="c1"># access last index</span>
<spanclass="n">m</span><spanclass="p">[:</span><spanclass="mi">2</span><spanclass="p">]</span><spanclass="c1"># sub vector m[0],m[1]</span>
<spanclass="n">m</span><spanclass="p">[::</span><spanclass="o">-</span><spanclass="mi">1</span><spanclass="p">,:]</span><spanclass="c1"># access in decreasing order</span>
<h2id="Scipy-linear-algebra-routines"><ahref="http://docs.scipy.org/doc/numpy/reference/routines.linalg.html">Scipy linear algebra routines</a><aclass="anchor-link"href="#Scipy-linear-algebra-routines">¶</a></h2><divclass="highlight"><pre><span></span><spanclass="n">m</span><spanclass="o">=</span><spanclass="n">np</span><spanclass="o">.</span><spanclass="n">array</span><spanclass="p">([[</span><spanclass="mi">1</span><spanclass="p">,</span><spanclass="mi">2</span><spanclass="p">,</span><spanclass="mi">3</span><spanclass="p">],[</span><spanclass="mi">4</span><spanclass="p">,</span><spanclass="mi">5</span><spanclass="p">,</span><spanclass="mi">6</span><spanclass="p">],[</span><spanclass="mi">7</span><spanclass="p">,</span><spanclass="mi">8</span><spanclass="p">,</span><spanclass="mi">9</span><spanclass="p">]])</span>