Home · Quickstart · User Guide and Examples · Interfaces Index · Developers · About · Nipy

# nipype.interfaces.utility.csv module

CSV Handling utilities

## CSVReader

Link to code

> Bases: BaseInterface

> Examples

>     >>> reader = CSVReader()
>     >>> reader.inputs.in_file = 'noHeader.csv'
>     >>> out = reader.run()
>     >>> out.outputs.column_0 == ['foo', 'bar', 'baz']
>     True
>     >>> out.outputs.column_1 == ['hello', 'world', 'goodbye']
>     True
>     >>> out.outputs.column_2 == ['300.1', '5', '0.3']
>     True

>     >>> reader = CSVReader()
>     >>> reader.inputs.in_file = 'header.csv'
>     >>> reader.inputs.header = True
>     >>> out = reader.run()
>     >>> out.outputs.files == ['foo', 'bar', 'baz']
>     True
>     >>> out.outputs.labels == ['hello', 'world', 'goodbye']
>     True
>     >>> out.outputs.erosion == ['300.1', '5', '0.3']
>     True

> in_filea pathlike object or string representing an existing file

>   Input comma-seperated value (CSV) file.

> headera boolean

>   True if the first line is a column header. (Nipype default value: `False`)

> CSVReader.output_spec

>   alias of `nipype.interfaces.base.specs.DynamicTraitedSpec`