Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)
Creates a matrix instance from a csv file.

Note: Any lines beginning with a hash  (#) are ignored

Parameters
        filename: The name of a file with a matrix in csv format
        readHeaders: True if the first (non-comment) line of the csv file should be interpreted
                as giving the column headers. Default is True.
        dialect: An instance of the csv.Dialect class containing information
        on the dialect of the csv file. Defaults to None.(more...)

        def matrixFromCSVFile(filename, readHeaders=True, dialect=None):

	'''Creates a matrix instance from a csv file.
	
	Note: Any lines beginning with a hash  (#) are ignored
	
	Parameters
		filename: The name of a file with a matrix in csv format
		readHeaders: True if the first (non-comment) line of the csv file should be interpreted
			as giving the column headers. Default is True.
		dialect: An instance of the csv.Dialect class containing information
		on the dialect of the csv file. Defaults to None.
		In this case the function tries to deduce the dialect itself.
		
	Return
		Returns a Matrix instance
		
	Exceptions:
		Raises an IOError if no file called filename exists
		Raises a TypeError if a matrix could not be read from the file'''
	
	#Open the file and read the contents
	#Then pass it to matrixFromCSVRepresentation
	fileObject = open(filename, 'r')
	string = fileObject.read()
	fileObject.close()
	
	return matrixFromCSVRepresentation(string, readHeaders, dialect)
        


src/p/e/PEATDB-2.3/PEATDB/plugins/PCA.py   PEATDB(Download)
        f.subplots_adjust(hspace=1,wspace=1) 
 
        m = Core.Matrix.matrixFromCSVFile(filename)
        evals, evecs, z = self.doPCA(m)
        self.plotResults(evals, evecs, z, m)
    P = PCAPlugin()
    if opts.file != None and os.path.exists(opts.file):
        r = Core.Matrix.matrixFromCSVFile(opts.file)
        if opts.start != None:
            m = r[:, opts.start:]