loading-data-from-files/slides.tex
author bhanu
Fri, 12 Nov 2010 00:36:35 +0530
changeset 490 2280bbdce638
parent 277 d4cee7ebcf9b
permissions -rw-r--r--
Language check done for `getting started with lists`
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
277
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
     1
% Created 2010-10-10 Sun 18:12
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
     2
\documentclass[presentation]{beamer}
217
b595f90016c5 Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     3
\usepackage[latin1]{inputenc}
b595f90016c5 Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     4
\usepackage[T1]{fontenc}
277
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
     5
\usepackage{fixltx2e}
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
     6
\usepackage{graphicx}
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
     7
\usepackage{longtable}
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
     8
\usepackage{float}
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
     9
\usepackage{wrapfig}
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    10
\usepackage{soul}
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    11
\usepackage{textcomp}
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    12
\usepackage{marvosym}
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    13
\usepackage{wasysym}
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    14
\usepackage{latexsym}
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    15
\usepackage{amssymb}
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    16
\usepackage{hyperref}
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    17
\tolerance=1000
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    18
\usepackage[english]{babel} \usepackage{ae,aecompl}
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    19
\usepackage{mathpazo,courier,euler} \usepackage[scaled=.95]{helvet}
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    20
\usepackage{listings}
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    21
\lstset{language=Python, basicstyle=\ttfamily\bfseries,
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    22
commentstyle=\color{red}\itshape, stringstyle=\color{darkgreen},
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    23
showstringspaces=false, keywordstyle=\color{blue}\bfseries}
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    24
\providecommand{\alert}[1]{\textbf{#1}}
217
b595f90016c5 Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    25
277
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    26
\title{Loading data from files}
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    27
\author{FOSSEE}
217
b595f90016c5 Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    28
\date{}
b595f90016c5 Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    29
277
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    30
\usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\setbeamercovered{transparent}
217
b595f90016c5 Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    31
\begin{document}
b595f90016c5 Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    32
277
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    33
\maketitle
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    34
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    35
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    36
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    37
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    38
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    39
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    40
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    41
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    42
217
b595f90016c5 Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    43
\begin{frame}
277
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    44
\frametitle{Outline}
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    45
\label{sec-1}
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    46
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    47
\begin{itemize}
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    48
\item Read data from files with a single column of data
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    49
\item Read data from files with multiple columns
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    50
\end{itemize}
217
b595f90016c5 Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    51
\end{frame}
277
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    52
\begin{frame}
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    53
\frametitle{Question 1}
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    54
\label{sec-2}
217
b595f90016c5 Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    55
277
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    56
  Read the file \texttt{pendulum\_semicolon.txt} which contains the same data
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    57
  as \texttt{pendulum.txt}, but the columns are separated by semi-colons
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    58
  instead of spaces. Use the IPython help to see how to do this.
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    59
\end{frame}
217
b595f90016c5 Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    60
\begin{frame}[fragile]
277
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    61
\frametitle{Solution 1}
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    62
\label{sec-3}
217
b595f90016c5 Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    63
277
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    64
\lstset{language=Python}
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    65
\begin{lstlisting}
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    66
In []: L, T = loadtxt('/home/fossee/pendulum_semicolon.txt', unpack=True, delimiter=';')
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    67
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    68
In []: print L
217
b595f90016c5 Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    69
277
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    70
In []: print T
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    71
\end{lstlisting}
217
b595f90016c5 Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    72
\end{frame}
b595f90016c5 Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    73
\begin{frame}
277
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    74
\frametitle{Summary}
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    75
\label{sec-4}
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    76
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    77
\begin{itemize}
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    78
\item Read data from files, containing a single column of data using the
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    79
    \texttt{loadtxt} command.
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    80
\item Read multiple columns of data, separated by spaces or other
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    81
    delimiters.
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    82
\end{itemize}
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    83
\end{frame}
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    84
\begin{frame}
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    85
\frametitle{Thank you!}
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    86
\label{sec-5}
d4cee7ebcf9b Slides for loading data from files LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 217
diff changeset
    87
217
b595f90016c5 Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    88
  \begin{block}{}
b595f90016c5 Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    89
  \begin{center}
b595f90016c5 Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    90
  This spoken tutorial has been produced by the
b595f90016c5 Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    91
  \textcolor{blue}{FOSSEE} team, which is funded by the 
b595f90016c5 Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    92
  \end{center}
b595f90016c5 Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    93
  \begin{center}
b595f90016c5 Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    94
    \textcolor{blue}{National Mission on Education through \\
b595f90016c5 Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    95
      Information \& Communication Technology \\ 
b595f90016c5 Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    96
      MHRD, Govt. of India}.
b595f90016c5 Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    97
  \end{center}  
b595f90016c5 Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    98
  \end{block}
b595f90016c5 Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    99
\end{frame}
b595f90016c5 Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   100
b595f90016c5 Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   101
\end{document}