Pastebin

Paste #25035: No description

< previous paste - next paste>

Pasted by Anonymous Coward

Download View as text

Traceback (most recent call last):
  File "pandas\_libs\parsers.pyx", line 1124, in pandas._libs.parsers.TextReader._convert_tokens
TypeError: Cannot cast array data from dtype('O') to dtype('float64') according to the rule 'safe'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\pyprojects\foo\dataspell-venv\python3.11-venv\Lib\site-packages\IPython\core\interactiveshell.py", line 3460, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "C:\Users\username\AppData\Local\Temp\ipykernel_26632\2508867478.py", line 17, in <module>
    df = load_data(file_list)
         ^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\username\AppData\Local\Temp\ipykernel_26632\2508867478.py", line 9, in load_data
    df = pd.read_csv(file, parse_dates=[0], decimal=".", quoting=csv.QUOTE_ALL , dtype={1: float})
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\pyprojects\foo\dataspell-venv\python3.11-venv\Lib\site-packages\pandas\util\_decorators.py", line 211, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\pyprojects\foo\dataspell-venv\python3.11-venv\Lib\site-packages\pandas\util\_decorators.py", line 331, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\pyprojects\foo\dataspell-venv\python3.11-venv\Lib\site-packages\pandas\io\parsers\readers.py", line 950, in read_csv
    return _read(filepath_or_buffer, kwds)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\pyprojects\foo\dataspell-venv\python3.11-venv\Lib\site-packages\pandas\io\parsers\readers.py", line 611, in _read
    return parser.read(nrows)
           ^^^^^^^^^^^^^^^^^^
  File "C:\pyprojects\foo\dataspell-venv\python3.11-venv\Lib\site-packages\pandas\io\parsers\readers.py", line 1778, in read
    ) = self._engine.read(  # type: ignore[attr-defined]
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\pyprojects\foo\dataspell-venv\python3.11-venv\Lib\site-packages\pandas\io\parsers\c_parser_wrapper.py", line 230, in read
    chunks = self._reader.read_low_memory(nrows)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "pandas\_libs\parsers.pyx", line 808, in pandas._libs.parsers.TextReader.read_low_memory
  File "pandas\_libs\parsers.pyx", line 890, in pandas._libs.parsers.TextReader._read_rows
  File "pandas\_libs\parsers.pyx", line 1037, in pandas._libs.parsers.TextReader._convert_column_data
  File "pandas\_libs\parsers.pyx", line 1130, in pandas._libs.parsers.TextReader._convert_tokens
ValueError: could not convert string to float: ' '

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\pyprojects\foo\dataspell-venv\python3.11-venv\Lib\site-packages\IPython\core\interactiveshell.py", line 2057, in showtraceback
    stb = self.InteractiveTB.structured_traceback(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\pyprojects\foo\dataspell-venv\python3.11-venv\Lib\site-packages\IPython\core\ultratb.py", line 1288, in structured_traceback
    return FormattedTB.structured_traceback(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\pyprojects\foo\dataspell-venv\python3.11-venv\Lib\site-packages\IPython\core\ultratb.py", line 1177, in structured_traceback
    return VerboseTB.structured_traceback(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\pyprojects\foo\dataspell-venv\python3.11-venv\Lib\site-packages\IPython\core\ultratb.py", line 1049, in structured_traceback
    formatted_exceptions += self.format_exception_as_a_whole(etype, evalue, etb, lines_of_context,
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\pyprojects\foo\dataspell-venv\python3.11-venv\Lib\site-packages\IPython\core\ultratb.py", line 935, in format_exception_as_a_whole
    self.get_records(etb, number_of_lines_of_context, tb_offset) if etb else []
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\pyprojects\foo\dataspell-venv\python3.11-venv\Lib\site-packages\IPython\core\ultratb.py", line 1003, in get_records
    lines, first = inspect.getsourcelines(etb.tb_frame)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\username\AppData\Local\Programs\Python\Python311\Lib\inspect.py", line 1244, in getsourcelines
    lines, lnum = findsource(object)
                  ^^^^^^^^^^^^^^^^^^
  File "C:\Users\username\AppData\Local\Programs\Python\Python311\Lib\inspect.py", line 1081, in findsource
    raise OSError('could not get source code')
OSError: could not get source code

New Paste


Do not write anything in this field if you're a human.

Go to most recent paste.