Skip to content

read_csv should present the column name/index in case 'Integer column has NA values' exception #10515

Closed
@vscolear

Description

@vscolear

Exception stack message:

---------------------------------------------------------------------------
Exception                                 Traceback (most recent call last)
<ipython-input-21-06190a246c08> in <module>()
      2     d3_df = pd.read_csv(d3_file, sep='|', skipinitialspace=True, header=None,
      3                        names=d3_col_names, index_col=False, dtype=d3_dtypes,
----> 4                        parse_dates=['timestamp'])

/Users/vs791j/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pandas/io/parsers.pyc in parser_f(filepath_or_buffer, sep, dialect, compression, doublequote, escapechar, quotechar, quoting, skipinitialspace, lineterminator, header, index_col, names, prefix, skiprows, skipfooter, skip_footer, na_values, na_fvalues, true_values, false_values, delimiter, converters, dtype, usecols, engine, delim_whitespace, as_recarray, na_filter, compact_ints, use_unsigned, low_memory, buffer_lines, warn_bad_lines, error_bad_lines, keep_default_na, thousands, comment, decimal, parse_dates, keep_date_col, dayfirst, date_parser, memory_map, float_precision, nrows, iterator, chunksize, verbose, encoding, squeeze, mangle_dupe_cols, tupleize_cols, infer_datetime_format, skip_blank_lines)
    472                     skip_blank_lines=skip_blank_lines)
    473 
--> 474         return _read(filepath_or_buffer, kwds)
    475 
    476     parser_f.__name__ = name

/Users/vs791j/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pandas/io/parsers.pyc in _read(filepath_or_buffer, kwds)
    258         return parser
    259 
--> 260     return parser.read()
    261 
    262 _parser_defaults = {

/Users/vs791j/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pandas/io/parsers.pyc in read(self, nrows)
    719                 raise ValueError('skip_footer not supported for iteration')
    720 
--> 721         ret = self._engine.read(nrows)
    722 
    723         if self.options.get('as_recarray'):

/Users/vs791j/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pandas/io/parsers.pyc in read(self, nrows)
   1168 
   1169         try:
-> 1170             data = self._reader.read(nrows)
   1171         except StopIteration:
   1172             if nrows is None:

pandas/parser.pyx in pandas.parser.TextReader.read (pandas/parser.c:7544)()

pandas/parser.pyx in pandas.parser.TextReader._read_low_memory (pandas/parser.c:7784)()

pandas/parser.pyx in pandas.parser.TextReader._read_rows (pandas/parser.c:8617)()

pandas/parser.pyx in pandas.parser.TextReader._convert_column_data (pandas/parser.c:9928)()

pandas/parser.pyx in pandas.parser.TextReader._convert_tokens (pandas/parser.c:10536)()

pandas/parser.pyx in pandas.parser.TextReader._convert_with_dtype (pandas/parser.c:11390)()

Exception: Integer column has NA values

Metadata

Metadata

Assignees

No one assigned

    Labels

    Error ReportingIncorrect or improved errors from pandasIO CSVread_csv, to_csv

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions