pandas 0.7.0 documentation

pandas.io.parsers.read_csv

pandas.io.parsers.read_csv(filepath_or_buffer, sep=', ', header=0, index_col=None, names=None, skiprows=None, na_values=None, parse_dates=False, date_parser=None, nrows=None, iterator=False, chunksize=None, skip_footer=0, converters=None, verbose=False, delimiter=None, encoding=None)

Read CSV (comma-separated) file into DataFrame

Also supports optionally iterating or breaking of the file into chunks.

Parameters :

filepath_or_buffer : string or file handle / StringIO

sep : string, default ‘,’

Delimiter to use. If sep is None, will try to automatically determine this

header : int, default 0

Row to use for the column labels of the parsed DataFrame

skiprows : list-like or integer

Row numbers to skip (0-indexed) or number of rows to skip (int)

index_col : int or sequence, default None

Column to use as the row labels of the DataFrame. If a sequence is given, a MultiIndex is used.

names : array-like

List of column names

na_values : list-like, default None

List of additional strings to recognize as NA/NaN

parse_dates : boolean, default False

Attempt to parse dates in the index column(s)

date_parser : function

Function to use for converting dates to strings. Defaults to dateutil.parser

nrows : int, default None

Number of rows of file to read. Useful for reading pieces of large files

iterator : boolean, default False

Return TextParser object

chunksize : int, default None

Return TextParser object for iteration

skip_footer : int, default 0

Number of line at bottom of file to skip

converters : dict. optional

Dict of functions for converting values in certain columns. Keys can either be integers or column labels

verbose : boolean, default False

Indicate number of NA values placed in non-numeric columns

delimiter : string, default None

Alternative argument name for sep

encoding : string, default None

Encoding to use for UTF when reading/writing (ex. ‘utf-8’)

Returns :

result : DataFrame or TextParser