[pymvpa] Syntax Error

Michael Hanke michael.hanke at gmail.com
Fri Dec 19 19:41:35 UTC 2008


On Fri, Dec 19, 2008 at 02:14:32PM -0500, Yune Lee wrote:
>  Dear pyMVPA experts,
> 
>  I'm now trying the simple example (Tiny example of a full cross-validation)
> and running into an error
>  as is shown in the attached file.
>  Can anyone help me with figuring this out?
Looks like you typed that by hand, right?

In Python you need to be very careful about indentation.

If you want to paste something into IPython you better use the magix
%cpaste function. Here is how it works:


	michael at gandalf:(git)~/hacking/pymvpa.dev:mvpa/data[master]$ ipython
	Python 2.5.2 (r252:60911, Nov 14 2008, 19:46:32) 
	Type "copyright", "credits" or "license" for more information.

	IPython 0.8.4 -- An enhanced Interactive Python.
	?         -> Introduction and overview of IPython's features.
	%quickref -> Quick reference.
	help      -> Python's own help system.
	object?   -> Details about 'object'. ?object also works, ?? prints more.

	In [1]: %cpaste
	Pasting code; enter '--' alone on the line to stop.
	:# get PyMVPA running
	:from mvpa.suite import *
	:
	:# load PyMVPA example dataset
	:attr = SampleAttributes('attributes.txt')
	:dataset = NiftiDataset(samples='bold.nii.gz',
	:                       labels=attr.labels,
	:                       chunks=attr.chunks,
	:                       mask='mask.nii.gz')
	:
	:--

	In [2]: 



-- 
GPG key:  1024D/3144BE0F Michael Hanke
http://apsy.gse.uni-magdeburg.de/hanke
ICQ: 48230050



More information about the Pkg-ExpPsy-PyMVPA mailing list