PYTHON EEG ANALYSIS EXAMPLE FROM THINK PYTHON HOW TO THINK LIKE A COMPUTER SCIENTIST.

Slides:



Advertisements
Similar presentations
Database vocabulary. Data Information entered in a database.
Advertisements

Simulation and Modeling: Predator-Prey Processing Lab IS 101Y/CMSC 101 Computational Thinking and Design Tuesday, October 1, 2013 Carolyn Seaman University.
Simulation and Modeling: Predator-Prey Processing Lab IS 101Y/CMSC 101 Computational Thinking and Design Tuesday, October 1, 2013 Marie desJardins University.
Templated Functions. Overloading vs Templating  Overloaded functions allow multiple functions with the same name.
Creating New Financial Statements In Excel Presented by: Nancy Ross.
London & Zurich Plc User Guide. Service Benefits Full on-line management of client accounts Paperless direct debit – no signatures required Standing orders.
User Guide. Service Benefits  Full on-line management of client accounts  Paperless direct debit – no signatures required  Standing orders fixed not.
 Option 1 › Separate entries and hide fields › Hide columns or use separate spreadsheets  Option 2 › Build them up in pieces › Use parentheses if you.
Converting Microsoft Office Documents Bill Weber E-Learning Systems Administrator E-Learning Operations.
 Cut and paste sometimes works  More likely want to go to temp sheet  Get it in any way you can  AND THEN clean it up.
 1.1: Introduction  1.2: Descriptions  1.2.1: White wine description  1.2.2: Brest Tissue description  1.3: Conclusion.
Graphing Examples Categorical Variables
PYTHON PLOTTING CURVES CHAPTER 10_5 FROM THINK PYTHON HOW TO THINK LIKE A COMPUTER SCIENTIST.
1 CSC 221: Introduction to Programming Fall 2012 Functions & Modules  standard modules: math, random  Python documentation, help  user-defined functions,
Python – Part 3 Functions 1. Function Calls Function – A named sequence of statements that performs a computation – Name – Sequence of statements “call”
Introduction to Python By Neil Cook Twitter: njcuk Slides/Notes:
Plotting in Microsoft Excel. 1) Enter your data into the Excel spreadsheet in table format. Your data should have column headers, row headers and data.
All rights reserved, property and © CAD Computer GmbH & Co.KG 2009 Cover page.
Intro Python: Variables, Indexing, Numbers, Strings.
C++ Basics #7 Basic Input and Output. In this video Standard output (cout) Standard input (cin) stringstream.
Matlab Demo #1 ODE-solver with parameters. Summary Here we will – Modify a simple matlab script in order to split the tasks to be sent to the cluster.
Variables When programming it is often necessary to store a value for use later on in the program. A variable is a label given to a location in memory.
Python Conditionals chapter 5
OCR Computing GCSE © Hodder Education 2013 Slide 1 OCR GCSE Computing Python programming 8: Fun with strings.
Parsing BLAST output. Output of a local BLAST search “less” program Full path to the BLAST output file.
ENG College of Engineering Engineering Education Innovation Center 1 Basic For Loops in MATLAB Programming in MATLAB / Chapter 6 Topics Covered:
Python Functions : chapter 3
INPUT & VARIABLES.
Computer Applications Chapter 16. Management Information Systems Management Information Systems (MIS)- an organized system of processing and reporting.
GEO375 Final Project: From Txt to Geocoded Data. Goal My Final project is to automate the process of separating, geocoding and processing 911 data for.
1 Lecture 5 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
1-4 Tools and procedures  Science tools: computer, electronic balances, microscope, telescope  Scientists use a common system of measurement because.
More Oracle SQL Scripts. Highlight (but don’t open) authors table, got o External data Excel, and make an external spreadsheet with the data.
PYTHON VARIABLES : CHAPTER 2 FROM THINK PYTHON HOW TO THINK LIKE A COMPUTER SCIENTIST.
1 CSE 2337 Chapter 7 Organizing Data. 2 Overview Import unstructured data Concatenation Parse Create Excel Lists.
Handling Arrays 1/2 Numerical Computing with. MATLAB for Scientists and Engineers.
Python for Informatics: Exploring Information
Python focus – files The open keyword returns a file object Opening a file myFile = open('C:\file.txt', arg) Optional argument The second argument controls.
Shiny: Improving IEP Meetings By Charles Yerkey (Left Click or press Right Arrow to advance slides)
Input, Output and Variables GCSE Computer Science – Python.
Number Systems Decimal Can you write 12,045 in expanded form? Base? Allowable digits for each place?
Creates the file on disk and opens it for writing
Making a JSON file.
Computing and Data Analysis
From Think Python How to Think Like a Computer Scientist
Design & Technology Grade 7 Python
Quarterly Training Meeting
Final Project: Read from a csv file and write to a database table
What are variables? Using input()
And now for something completely different . . .
CSV File Manipulation.
INC 161 , CPE 100 Computer Programming
Data types Numeric types Sequence types float int bool list str
Another way Here is a different, possibly better way to deal with the problem of the height (e.g. 5-11) being converted to a date (e.g. May 11, 2004) when.
Python plotting curves chapter 10_5
Strings and Lists – the split method
Creates the file on disk and opens it for writing
The graph of f(x) is depicted on the left. At x=0.5,
Changing one data type into another
What are variables? Using input()
CSV files Professor Hugh C. Lauer CS-1004 — Introduction to Programming for Non-Majors (Slides include materials from Python Programming: An Introduction.
15-110: Principles of Computing
Appending or adding to a file using python
Introduction to Computer Science
Introduction to Computer Science
What are variables? Using input()
Box Plots CCSS 6.7.
How to Create Tables & Graphs in Excel
Line Graphs.
Introduction to Computer Science
Presentation transcript:

PYTHON EEG ANALYSIS EXAMPLE FROM THINK PYTHON HOW TO THINK LIKE A COMPUTER SCIENTIST

EEG DATA COLLECTION

THEIR TEST BENCH

GENERATES A CSV FILE LOOKS LIKE THE FOLLOWING IN EXCEL Channels sample number

LOOKING AT IT IN NOTEPAD++

Suppose we just want channel 2 and none of the other data. We will use Python to extract that column only. Once it is extracted we can graph it.

OPEN THE FILE AND READ IT. File=open("eegdata.csv",'r') File.readline(); # Get rid of the first line. # It contains only header data for line in File: print line # The above should open the file and print it out one line at a time. # As soon as this works we can then process each line

REMEMBER SPLIT? If we have a string (or line) that is a CSV string we can split it into pieces and place the result into a list. Example : str = “34,23,65,77,12” a = str.split(‘,’) print a ['34', '23', '65', '77', '12'] But these are strings in a list and not numbers. So. a[2] is ‘65’. Can we convert this guy to a float? float(a[2]) is now 65 Capice?!

THE SCRIPT File=open("eegdata.csv",'r') File.readline(); channel = [] for line in File: list=line.split(',') channel.append(float(list[2])) print channel plot (channel[0:128)) # only plot the first 128 samples

WHAT ABOUT MULTIPLE GRAPHS File=open("eegdata.csv",'r') File.readline(); channel = [] for line in File: list=line.split(',') channel.append(float(list[2])) print channel figure(1) plot(channel[:128]) figure(2) plot(channel[128:256])