statistics/slides.org
author Amit Sethi
Thu, 11 Nov 2010 01:37:32 +0530
changeset 450 d49aee7ab1b9
parent 321 2e49b1b72996
permissions -rw-r--r--
Rewrite of statistics script as suggested by punch and change in slides accordingly

#+LaTeX_CLASS: beamer
#+LaTeX_CLASS_OPTIONS: [presentation]
#+BEAMER_FRAME_LEVEL: 1

#+BEAMER_HEADER_EXTRA: \usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\setbeamercovered{transparent}
#+COLUMNS: %45ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Env Args) %4BEAMER_col(Col) %8BEAMER_extra(Extra)
#+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

#+LaTeX_CLASS: beamer
#+LaTeX_CLASS_OPTIONS: [presentation]

#+LaTeX_HEADER: \usepackage[english]{babel} \usepackage{ae,aecompl}
#+LaTeX_HEADER: \usepackage{mathpazo,courier,euler} \usepackage[scaled=.95]{helvet}

#+LaTeX_HEADER: \usepackage{listings}

#+LaTeX_HEADER:\lstset{language=Python, basicstyle=\ttfamily\bfseries,
#+LaTeX_HEADER:  commentstyle=\color{red}\itshape, stringstyle=\color{darkgreen},
#+LaTeX_HEADER:  showstringspaces=false, keywordstyle=\color{blue}\bfseries}

#+TITLE: Statistics
#+AUTHOR: FOSSEE
#+DATE
#+EMAIL:     info@fossee.in

#+DESCRIPTION: 
#+KEYWORDS: 
#+LANGUAGE:  en
#+OPTIONS:   H:3 num:nil toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
#+OPTIONS:   TeX:t LaTeX:nil skip:nil d:nil todo:nil pri:nil tags:not-in-toc


* Outline 
 - Doing statistical operations in Python  
   - Summing set of numbers
   - Finding there mean
   - Finding there Median
   - Finding there Standard Deviation 

* Data set
  - A;015163;JOSEPH RAJ S;083;042;47;00;72;244;;; 

  The following are the fields in any given line.
   - Region Code which is 'A'
   - Roll Number 015163
   - Name JOSEPH RAJ S
   - Marks of 5 subjects: -- English 083 -- 
     Hindi 042 -- Maths 47 --
     Science 35 -- Social 72
   - Total marks 244

* Question
  - In the given file football.txt at path /home/fossee/football.txt , 
    one column is player name,second is goals at home 
    and third goals away.
    - Find the total goals for each player
    - Mean home and away goals
    - Standard deviation of home and away goals 

* Solution
#+begin_src python
  L=loadtxt('/home/amit/football.txt',usecols=(1,2),
            delimiter=',')
  sum(L,1)
  mean(L,0)
  std(L,0)
#+end_src python

* Summary 
  - sum
  - mean
  - median
  - std