hashtag in headerlines
See original GitHub issueThe 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:
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’
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
How can read 'Numeral Signs-#' as part of a column header?
The file I am trying to read in has a 'numeral sign-#' (aka hash symbol) in the column header. When I used read.table...
Read more >Purpose of ### (3 consecutive pound signs / hashtags ...
After searching the file for the # character, I noticed many lines that contain only three hashtag ( # ) symbols. Why are...
Read more >How to store streaming Tweets in a Google Sheet | Docs
This image displays the example of what the Google Sheet header lines ... term and hashtag you set, Tweets should start appearing in...
Read more >Gerrit Code Review - /changes/ REST API
Gets the hashtags associated with a change. Request ... References to the header lines will result in errors when the fix is applied....
Read more >How do I determine the number of headerlines in a text ...
Learn more about headerline, textscan, text file. ... The document starts with an unknown number of headerlines (zero up to 20), and the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The error message is not very helpful
Hi folks: taking.