Skip to content

OverflowError when loading uint64 from csv #11440

Closed
@teto

Description

@teto

Hi,
I am trying to plot a set of values that are all uint64 with panda
The csv file is available here https://transfer.sh/Sy5DS/iperf-client-linux-2rtrs-f30b30-f30b30-w140k-lia-run1.csv and this is the command I used:

In [6]: df = pd.read_csv('/home/teto/ns3testing/iperf-client-linux_2rtrs_f30b30_f30b30_w140K_lia-run1.csv', sep='|', dtype={'dsn': np.uint64})
---------------------------------------------------------------------------
OverflowError                             Traceback (most recent call last)
<ipython-input-6-794bcaffa179> in <module>()
----> 1 df = pd.read_csv('/home/teto/ns3testing/iperf-client-linux_2rtrs_f30b30_f30b30_w140K_lia-run1.csv', sep='|', dtype={'dsn': np.uint64})

/usr/lib/python3/dist-packages/pandas/io/parsers.py 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)
    461                     skip_blank_lines=skip_blank_lines)
    462 
--> 463         return _read(filepath_or_buffer, kwds)
    464 
    465     parser_f.__name__ = name

/usr/lib/python3/dist-packages/pandas/io/parsers.py in _read(filepath_or_buffer, kwds)
    247         return parser
    248 
--> 249     return parser.read()
    250 
    251 _parser_defaults = {

/usr/lib/python3/dist-packages/pandas/io/parsers.py in read(self, nrows)
    704                 raise ValueError('skip_footer not supported for iteration')
    705 
--> 706         ret = self._engine.read(nrows)
    707 
    708         if self.options.get('as_recarray'):

/usr/lib/python3/dist-packages/pandas/io/parsers.py in read(self, nrows)
   1148 
   1149         try:
-> 1150             data = self._reader.read(nrows)
   1151         except StopIteration:
   1152             if nrows is None:

/usr/lib/python3/dist-packages/pandas/parser.cpython-34m-x86_64-linux-gnu.so in pandas.parser.TextReader.read (pandas/parser.c:7287)()

/usr/lib/python3/dist-packages/pandas/parser.cpython-34m-x86_64-linux-gnu.so in pandas.parser.TextReader._read_low_memory (pandas/parser.c:7511)()

/usr/lib/python3/dist-packages/pandas/parser.cpython-34m-x86_64-linux-gnu.so in pandas.parser.TextReader._read_rows (pandas/parser.c:8336)()

/usr/lib/python3/dist-packages/pandas/parser.cpython-34m-x86_64-linux-gnu.so in pandas.parser.TextReader._convert_column_data (pandas/parser.c:9544)()

/usr/lib/python3/dist-packages/pandas/parser.cpython-34m-x86_64-linux-gnu.so in pandas.parser.TextReader._convert_tokens (pandas/parser.c:10106)()

/usr/lib/python3/dist-packages/pandas/parser.cpython-34m-x86_64-linux-gnu.so in pandas.parser.TextReader._convert_with_dtype (pandas/parser.c:10503)()

/usr/lib/python3/dist-packages/pandas/parser.cpython-34m-x86_64-linux-gnu.so in pandas.parser._try_int64 (pandas/parser.c:18126)()

My version was the one with ubuntu's 15.04 repo
pd.version.version
Out[10]: '0.15.0'

I am trying to upgrade it, hoping it would solve this, would it ?
I believe the problem is related to:
#4471

I recently discovered panda and so far it's the best tool I found to plot/work with data (tried R/gnuplot etc...) thanks a lot for the work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Dtype ConversionsUnexpected or buggy dtype conversionsIO CSVread_csv, to_csv

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions