Skip to content

BUG: loadtxt raises an issue on file that used to work #21052

@larsoner

Description

@larsoner

Describe the issue:

Thanks to the --pre wheels, our CIs found some issues with (what I assume is) the loadtxt change to C.

Reproduce the code example:

  1. Running np.loadtxt(fname, skiprows=1) on this file or this file both used to work fine, now we get:

    mne\chpi.py:84: in read_head_pos
        data = np.loadtxt(fname, skiprows=1)  # first line is header, skip it
    C:\hostedtoolcache\windows\Python\3.9.9\x64\lib\site-packages\numpy\lib\npyio.py:1321: in loadtxt
        arr = _read(fname, dtype=dtype, comment=comment, delimiter=delimiter,
    C:\hostedtoolcache\windows\Python\3.9.9\x64\lib\site-packages\numpy\lib\npyio.py:999: in _read
        arr = _load_from_filelike(
    E   ValueError: could not convert string '' to float64 at row 0, column 11.
    
  2. Running with open(egi_txt_fname) as fid: data = np.loadtxt(fid) on this file used to work fine, now we get:

    C:\hostedtoolcache\windows\Python\3.9.9\x64\lib\site-packages\numpy\lib\npyio.py:1321: in loadtxt
        arr = _read(fname, dtype=dtype, comment=comment, delimiter=delimiter,
    C:\hostedtoolcache\windows\Python\3.9.9\x64\lib\site-packages\numpy\lib\npyio.py:999: in _read
        arr = _load_from_filelike(
    E   ValueError: could not convert string '' to float64 at row 0, column 78.
    

Error message:

No response

NumPy/Python version information:

Platform: Windows-10-10.0.17763-SP0
Python: 3.9.9 (tags/v3.9.9:ccb0e6a, Nov 15 2021, 18:08:50) [MSC v.1929 64 bit (AMD64)]
numpy: 1.23.0.dev0+735.g4c60b3263

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions