diff options
author | Prabhu Ramachandran | 2021-05-26 13:29:23 +0530 |
---|---|---|
committer | Prabhu Ramachandran | 2021-05-26 13:29:23 +0530 |
commit | 48f99d4a4ad9ab824180bb8ca73a29966b940bd3 (patch) | |
tree | e337ffa6e3401672199ceeb7c9439467a4533c60 | |
parent | 7d7861e7e6cd52129c88b3c7eda17c80bdf55da1 (diff) | |
download | python-workshops-48f99d4a4ad9ab824180bb8ca73a29966b940bd3.tar.gz python-workshops-48f99d4a4ad9ab824180bb8ca73a29966b940bd3.tar.bz2 python-workshops-48f99d4a4ad9ab824180bb8ca73a29966b940bd3.zip |
Minor updates and closing.
-rw-r--r-- | scipy/basic/06_numpy.tex | 18 | ||||
-rw-r--r-- | scipy/basic/12_closing.tex | 191 |
2 files changed, 195 insertions, 14 deletions
diff --git a/scipy/basic/06_numpy.tex b/scipy/basic/06_numpy.tex index 0f5e17c..87793eb 100644 --- a/scipy/basic/06_numpy.tex +++ b/scipy/basic/06_numpy.tex @@ -197,26 +197,18 @@ Out[]: array([3, 5, 7, 9]) In []: a*b Out[]: array([2, 6, 12, 20]) In []: a/b +Out[]: array([0.5, 0.666...7, 0.75, 0.8]) +In []: a//b Out[]: array([0, 0, 0, 0]) \end{lstlisting} \begin{itemize} \item Operations are \alert{element-wise} - \item Types matter (only on Python 2.x) + \item Types matter \end{itemize} \inctime{10} \end{frame} \begin{frame}[fragile] - \frametitle{Data type matters} - Try again with this: -\begin{lstlisting} -In []: a = array([1.,2,3,4]) -In []: a/b -\end{lstlisting} - This can happen on Python 2.x, so beware -\end{frame} - -\begin{frame}[fragile] \frametitle{Examples} \noindent \typ{pi} and \typ{e} are defined. \begin{lstlisting} @@ -232,7 +224,7 @@ In []: print(x[0], x[-1]) \end{frame} \begin{frame}[fragile] - \frametitle{\typ{size, shape, rank} etc.} + \frametitle{\typ{size, shape} etc.} \vspace*{-8pt} \begin{lstlisting} In []: x = array([1., 2, 3, 4]) @@ -242,8 +234,6 @@ In []: x.dtype dtype('float64') In []: x.shape Out[] (4,) -In []: rank(x) -Out[]: 1 In []: x.itemsize Out[]: 8 \end{lstlisting} diff --git a/scipy/basic/12_closing.tex b/scipy/basic/12_closing.tex new file mode 100644 index 0000000..39dc592 --- /dev/null +++ b/scipy/basic/12_closing.tex @@ -0,0 +1,191 @@ +\documentclass[14pt,compress]{beamer} +%\documentclass[draft]{beamer} +%\documentclass[compress,handout]{beamer} +%\usepackage{pgfpages} +%\pgfpagesuselayout{2 on 1}[a4paper,border shrink=5mm] + +% Modified from: generic-ornate-15min-45min.de.tex +\mode<presentation> +{ + \usetheme{Warsaw} + \useoutertheme{infolines} + \setbeamercovered{transparent} +} + +\usepackage[english]{babel} +\usepackage[latin1]{inputenc} +%\usepackage{times} +\usepackage[T1]{fontenc} +\usepackage{pgf} + +% Taken from Fernando's slides. +\usepackage{ae,aecompl} +\usepackage{mathpazo,courier,euler} +\usepackage[scaled=.95]{helvet} +\usepackage{amsmath} + +\definecolor{darkgreen}{rgb}{0,0.5,0} + +\usepackage{listings} +\lstset{language=Python, + basicstyle=\ttfamily\bfseries, + commentstyle=\color{red}\itshape, + stringstyle=\color{darkgreen}, + showstringspaces=false, + keywordstyle=\color{blue}\bfseries} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Macros +\setbeamercolor{emphbar}{bg=blue!20, fg=black} +\newcommand{\emphbar}[1] +{\begin{beamercolorbox}[rounded=true]{emphbar} + {#1} + \end{beamercolorbox} +} + +\newcommand{\myemph}[1]{\structure{\emph{#1}}} +\newcommand{\PythonCode}[1]{\lstinline{#1}} + +\newcounter{time} +\setcounter{time}{0} +\newcommand{\inctime}[1]{\addtocounter{time}{#1}{\tiny \thetime\ m}} + +\newcommand{\typ}[1]{\lstinline{#1}} + +\newcommand{\kwrd}[1]{ \texttt{\textbf{\color{blue}{#1}}} } + + +\newcommand\BackgroundPicture[1]{% + \setbeamertemplate{background}{% + \parbox[c][\paperheight]{\paperwidth}{% + \vfill \hfill + \pgfimage[width=1.0\paperwidth,height=1.0\paperheight]{#1} + \hfill \vfill +}}} + +% For non-wide pictures, set the width so that the height scales +% appropriately. +\newcommand\BackgroundPictureWidth[1]{% + \setbeamertemplate{background}{% + \parbox[c][\paperheight]{\paperwidth}{% + \vfill \hfill + \pgfimage[width=1.0\paperwidth]{#1} + \hfill \vfill +}}} + +% For shorter pictures, set the height so that the width scales +% appropriately. +\newcommand\BackgroundPictureHeight[1]{% + \setbeamertemplate{background}{% + \parbox[c][\paperheight]{\paperwidth}{% + \vfill \hfill + \pgfimage[height=1.0\paperheight]{#1} + \hfill \vfill +}}} + +%%% This is from Fernando's setup. +% \usepackage{color} +% \definecolor{orange}{cmyk}{0,0.4,0.8,0.2} +% % Use and configure listings package for nicely formatted code +% \usepackage{listings} +% \lstset{ +% language=Python, +% basicstyle=\small\ttfamily, +% commentstyle=\ttfamily\color{blue}, +% stringstyle=\ttfamily\color{orange}, +% showstringspaces=false, +% breaklines=true, +% postbreak = \space\dots +% } + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Title page +\title[Closing remarks]{Introductory Scientific Computing with +Python} +\subtitle{Closing remarks} + +\author{FOSSEE} + +\institute[FOSSEE -- IITB] {Department of Aerospace Engineering\\IIT Bombay} +\date[] { +Mumbai, India +} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%\pgfdeclareimage[height=0.75cm]{iitmlogo}{iitmlogo} +%\logo{\pgfuseimage{iitmlogo}} + + +%% Delete this, if you do not want the table of contents to pop up at +%% the beginning of each subsection: +\AtBeginSubsection[] +{ + \begin{frame}<beamer> + \frametitle{Outline} + \tableofcontents[currentsection,currentsubsection] + \end{frame} +} + +\AtBeginSection[] +{ + \begin{frame}<beamer> + \frametitle{Outline} + \tableofcontents[currentsection,currentsubsection] + \end{frame} +} + +% If you wish to uncover everything in a step-wise fashion, uncomment +% the following command: +%\beamerdefaultoverlayspecification{<+->} + +%\includeonlyframes{current,current1,current2,current3,current4,current5,current6} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% DOCUMENT STARTS +\begin{document} + +\begin{frame} + \maketitle +\end{frame} + +\begin{frame}[fragile] + \frametitle{Summary} + \begin{itemize} + \item Learned how to use basic Python + \item IPython + \item Basic plotting with \typ{matplotlib} + \item \typ{numpy} arrays + \item Basic \typ{scipy} + \item Jupyter notebooks + \item Introduction to the Python syntax + \end{itemize} +\end{frame} + +\begin{frame} + \frametitle{What next?} + \begin{itemize} + \item Only covered the very basics + \item Read the official Python tutorial: + \url{docs.python.org/tutorial/} + \end{itemize} +\end{frame} + +\begin{frame} + \frametitle{Other courses} + \begin{itemize} + \item Learn more basic Python + \item Two day course on basic Python + \item Advanced Python course + \item Additional topics + \end{itemize} +\end{frame} + +\begin{frame} + \centering + \Huge + + Thank you! +\end{frame} +\end{document} + +\end{document} |