day2/session2.tex
changeset 77 3cb7e25f7c0e
parent 76 b24c2560f626
child 82 e352b67ab357
equal deleted inserted replaced
76:b24c2560f626 77:3cb7e25f7c0e
   122   \frametitle{Broadcasting}
   122   \frametitle{Broadcasting}
   123   Try it!
   123   Try it!
   124   \begin{lstlisting}
   124   \begin{lstlisting}
   125     >>> a = np.arange(4)
   125     >>> a = np.arange(4)
   126     >>> b = np.arange(5)
   126     >>> b = np.arange(5)
   127     >>> a+b
   127     >>> a+b #Does this work?
   128     >>> a+3
   128     >>> a+3
   129     >>> c=np.array([3])
   129     >>> c=np.array([3])
   130     >>> a+c
   130     >>> a+c #Works!
   131     >>> b+c
   131     >>> b+c #But how?
       
   132     >>> a.shape, b.shape, c.shape
   132   \end{lstlisting}
   133   \end{lstlisting}
   133   \begin{itemize}
   134   \begin{itemize}
   134     \item Enter Broadcasting!
   135     \item Enter Broadcasting!
   135   \end{itemize}
   136   \end{itemize}
   136 \end{frame}
   137 \end{frame}