Repository: numpy/numpy

Issue:
hashtag in headerlines
<!-- Please describe the issue in detail here, and fill in the fields below -->
The following csv file should be imported by genfromtxt.
```
"Label"; "Type"; "Dim"; "#N"; "N1"; "N2"; "N3"; "N4"; "N5"; "N6"; "N7"; "N8"; "N9"; "N10"
1; TET10; 3; 10; 955; 8100; 956; 8113; 957; 8101; 8102; 8114; 8127; 958
2; TET10; 3; 10; 959; 8150; 960; 8103; 955; 8104; 8140; 8141; 8102; 958
3; TET10; 3; 10; 955; 8105; 961; 8115; 956; 8100; 8102; 8142; 8114; 958
```

### Reproducing code example:
```python
import io
import numpy as np

data_file = io.StringIO("""\
"Label"; "Type"; "Dim"; "#N"; "N1"; "N2"; "N3"; "N4"; "N5"; "N6"; "N7"; "N8"; "N9"; "N10"
1; TET10; 3; 10; 955; 8100; 956; 8113; 957; 8101; 8102; 8114; 8127; 958
2; TET10; 3; 10; 959; 8150; 960; 8103; 955; 8104; 8140; 8141; 8102; 958
3; TET10; 3; 10; 955; 8105; 961; 8115; 956; 8100; 8102; 8142; 8114; 958""")

data = np.genfromtxt(data_file, delimiter=';',names=True,
    usecols=(0,1,2,3,4,5,6,7,8,9,10,11,12,13),
    dtype="i8,S6,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8")
```

### Error message:
```
ValueError: must replace all names at once with a sequence of length 14
```

### Numpy/Python version information:
Python 3.7.2 (default, Dec 29 2018, 06:19:36) 

>>> np.__version__
'1.15.4'




Discussion:
You can uses the `comments` argument to be something other than the default `"#"`
using `comments='%'` gets the data parsed, but the `#N` is turned into `N`
```
>>> np.genfromtxt('bug.csv',delimiter=';',names=True,usecols=\
(0,1,2,3,4,5,6,7,8,9,10,11,12,13),dtype="i8,S6,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8",\
 comments='%')
array([(1, b' TET10', 3, 10, 955, 8100, 956, 8113, 957, 8101, 8102, 8114, 8127, 958),
       (2, b' TET10', 3, 10, 959, 8150, 960, 8103, 955, 8104, 8140, 8141, 8102, 958),
       (3, b' TET10', 3, 10, 955, 8105, 961, 8115, 956, 8100, 8102, 8142, 8114, 958)],
      dtype=[('Label', '<i8'), ('Type', 'S6'), ('Dim', '<i8'), ('N', '<i8'),\
 ('N1', '<i8'), ('N2', '<i8'), ('N3', '<i8'), ('N4', '<i8'), ('N5', '<i8'), ('N6', '<i8'),\
 ('N7', '<i8'), ('N8', '<i8'), ('N9', '<i8'), ('N10', '<i8')])
```
Works fine if you override the `deletechars` argument:
```python
data = np.genfromtxt(data_file, delimiter=';',names=True,
    usecols=(0,1,2,3,4,5,6,7,8,9,10,11,12,13),
    dtype="i8,S6,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8",
    comments=None,
    deletechars='')
```
giving
```
array([(1, b' TET10', 3, 10, 955, 8100, 956, 8113, 957, 8101, 8102, 8114, 8127, 958),
       (2, b' TET10', 3, 10, 959, 8150, 960, 8103, 955, 8104, 8140, 8141, 8102, 958),
       (3, b' TET10', 3, 10, 955, 8105, 961, 8115, 956, 8100, 8102, 8142, 8114, 958)],
      dtype=[('Label', '<i8'), ('Type', 'S6'), ('Dim', '<i8'), ('#N', '<i8'), ('N1', '<i8'), ('N2', '<i8'), ('N3', '<i8'), ('N4', '<i8'), ('N5', '<i8'), ('N6', '<i8'), ('N7', '<i8'), ('N8', '<i8'), ('N9', '<i8'), ('N10', '<i8')])
```

Resolving patch:
diff --git a/numpy/lib/npyio.py b/numpy/lib/npyio.py
--- a/numpy/lib/npyio.py
+++ b/numpy/lib/npyio.py
@@ -1717,6 +1717,16 @@ def genfromtxt(fname, dtype=float, comments='#', delimiter=None,
     array((1, 1.3, b'abcde'),
           dtype=[('intvar', '<i8'), ('fltvar', '<f8'), ('strvar', 'S5')])
 
+    An example to show comments
+
+    >>> f = StringIO('''
+    ... text,# of chars
+    ... hello world,11
+    ... numpy,5''')
+    >>> np.genfromtxt(f, dtype='S12,S12', delimiter=',')
+    array([(b'text', b''), (b'hello world', b'11'), (b'numpy', b'5')],
+      dtype=[('f0', 'S12'), ('f1', 'S12')])
+
     """
     if max_rows is not None:
         if skip_footer:


Test patch: