loading-data-from-files/slides.org
changeset 324 4054b1a6392d
parent 277 d4cee7ebcf9b
equal deleted inserted replaced
323:e675f9208b91 324:4054b1a6392d
       
     1 #+LaTeX_CLASS: beamer
       
     2 #+LaTeX_CLASS_OPTIONS: [presentation]
       
     3 #+BEAMER_FRAME_LEVEL: 1
       
     4 
       
     5 #+BEAMER_HEADER_EXTRA: \usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\setbeamercovered{transparent}
       
     6 #+COLUMNS: %45ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Env Args) %4BEAMER_col(Col) %8BEAMER_extra(Extra)
       
     7 #+PROPERTY: BEAMER_col_ALL 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 :ETC
       
     8 
       
     9 #+LaTeX_CLASS: beamer
       
    10 #+LaTeX_CLASS_OPTIONS: [presentation]
       
    11 
       
    12 #+LaTeX_HEADER: \usepackage[english]{babel} \usepackage{ae,aecompl}
       
    13 #+LaTeX_HEADER: \usepackage{mathpazo,courier,euler} \usepackage[scaled=.95]{helvet}
       
    14 
       
    15 #+LaTeX_HEADER: \usepackage{listings}
       
    16 
       
    17 #+LaTeX_HEADER:\lstset{language=Python, basicstyle=\ttfamily\bfseries,
       
    18 #+LaTeX_HEADER:  commentstyle=\color{red}\itshape, stringstyle=\color{darkgreen},
       
    19 #+LaTeX_HEADER:  showstringspaces=false, keywordstyle=\color{blue}\bfseries}
       
    20 
       
    21 #+TITLE:    Loading data from files
       
    22 #+AUTHOR:    FOSSEE
       
    23 #+EMAIL:     
       
    24 #+DATE:    
       
    25 
       
    26 #+DESCRIPTION: 
       
    27 #+KEYWORDS: 
       
    28 #+LANGUAGE:  en
       
    29 #+OPTIONS:   H:3 num:nil toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
       
    30 #+OPTIONS:   TeX:t LaTeX:nil skip:nil d:nil todo:nil pri:nil tags:not-in-toc
       
    31 
       
    32 * Outline
       
    33   + Read data from files with a single column of data
       
    34   + Read data from files with multiple columns
       
    35 * Question 1
       
    36   Read the file ~pendulum_semicolon.txt~ which contains the same data
       
    37   as ~pendulum.txt~, but the columns are separated by semi-colons
       
    38   instead of spaces. Use the IPython help to see how to do this.
       
    39 * Solution 1
       
    40   #+begin_src python
       
    41     In []: L, T = loadtxt('/home/fossee/pendulum_semicolon.txt', unpack=True, delimiter=';')
       
    42     
       
    43     In []: print L
       
    44     
       
    45     In []: print T
       
    46   #+end_src
       
    47 * Summary
       
    48   + Read data from files, containing a single column of data using the
       
    49     ~loadtxt~ command.
       
    50   + Read multiple columns of data, separated by spaces or other
       
    51     delimiters.
       
    52 * Thank you!
       
    53 #+begin_latex
       
    54   \begin{block}{}
       
    55   \begin{center}
       
    56   This spoken tutorial has been produced by the
       
    57   \textcolor{blue}{FOSSEE} team, which is funded by the 
       
    58   \end{center}
       
    59   \begin{center}
       
    60     \textcolor{blue}{National Mission on Education through \\
       
    61       Information \& Communication Technology \\ 
       
    62       MHRD, Govt. of India}.
       
    63   \end{center}  
       
    64   \end{block}
       
    65 #+end_latex
       
    66 
       
    67