question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

hashtag in headerlines

See original GitHub issue

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:

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:open
  • Created 5 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
mattipcommented, Apr 26, 2019

The error message is not very helpful

0reactions
tapaswenipathakcommented, Jul 27, 2019

Hi folks: taking.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found