15.12.2012 Views

scipy tutorial - Baustatik-Info-Server

scipy tutorial - Baustatik-Info-Server

scipy tutorial - Baustatik-Info-Server

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3.6.5 Arff files (<strong>scipy</strong>.io.arff)<br />

Module to read arff files (weka format).<br />

SciPy Reference Guide, Release 0.8.dev<br />

arff is a simple file format which support numerical, string and data values. It supports sparse data too.<br />

See http://weka.sourceforge.net/wekadoc/index.php/en:ARFF_(3.4.6) for more details about arff format and available<br />

datasets.<br />

loadarff(filename) Read an arff file.<br />

loadarff(filename)<br />

Read an arff file.<br />

Notes<br />

Parameters<br />

filename : str<br />

the name of the file<br />

Returns<br />

data : record array<br />

the data of the arff file. Each record corresponds to one attribute.<br />

meta : MetaData<br />

this contains information about the arff file, like type and names of attributes, the<br />

relation (name of the dataset), etc...<br />

This function should be able to read most arff files. Not implemented functionalities include:<br />

•date type attributes<br />

•string type attributes<br />

It can read files with numeric and nominal attributes. It can read files with sparse data (? in the file).<br />

3.6.6 Netcdf (<strong>scipy</strong>.io.netcdf)<br />

netcdf_file(filename[, mode,<br />

mmap, version])<br />

netcdf_variable(data, typecode,<br />

shape, ...)<br />

A netcdf_file object has two standard attributes: dimensions<br />

and variables.<br />

netcdf_variable objects are constructed by calling the method<br />

class netcdf_file(filename, mode=’r’, mmap=None, version=1)<br />

A netcdf_file object has two standard attributes: dimensions and variables. The values of both are<br />

dictionaries, mapping dimension names to their associated lengths and variable names to variables, respectively.<br />

Application programs should never modify these dictionaries.<br />

All other attributes correspond to global attributes defined in the NetCDF file. Global file attributes are created<br />

by assigning to an attribute of the netcdf_file object.<br />

Methods<br />

close()<br />

createDimension(name, length)<br />

createVariable(name, type, dimensions)<br />

flush()<br />

sync()<br />

3.6. Input and output (<strong>scipy</strong>.io) 215

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!