Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8983813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:56:03+00:00 2026-06-15T20:56:03+00:00

I have CSV data which looks something like: Data 1,1,10 1,2,50 1,3,5 etc… And

  • 0

I have CSV data which looks something like:

Data

1,1,10
1,2,50
1,3,5
etc...

And I am trying to read in the data. However, my initial data does not contain a header row (as seen above) so it is taking the first data row to be the header (1,1,10). Is there anyway around this. I want to set the header names after I read the data

Javascript

d3.csv("data/testnh.csv", function(data) {
    console.log(data);
}

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T20:56:05+00:00Added an answer on June 15, 2026 at 8:56 pm

    Use d3.text to load the data, and then d3.csvParseRows to parse it. For example:

    d3.text("data/testnh.csv", function(text) {
      console.log(d3.csvParseRows(text));
    });
    

    You’ll probably also want to convert your columns to numbers, because they’ll be strings by default. Assume they are all numbers, you could say:

    d3.text("data/testnh.csv", function(text) {
      var data = d3.csvParseRows(text).map(function(row) {
        return row.map(function(value) {
          return +value;
        });
      });
      console.log(data);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a large data coming from a csv file which looks something like
I have data from travel diaries which has been read in from a csv
I have a csv file, transcation.csv , which looks like this: TransactionID,Date,AccNum,Type,Amt 657520,02-07-1999,016901581432,Debit,16000 657524,02-07-1999,016901581432,Debit,13000
I have a CSV file containing some user data it looks like this: 10333,,an.10,Kenyata,,Aaron,,,,,,,,,,
I have a time series(a csv file) data that looks like below. Each observation
I have .zip file which contain csv data. I am reading .zip file using
I have a System.Data.DataTable which is populated by reading a CSV file which sets
I have a csv file with data looking like (see below). I need help
Right now, if you have a test that looks like this: [TestMethod] [DeploymentItem(DataSource.csv)] [DataSource(
I have a lagre data frame which looks similar to this format: line1 line2<tab>value1

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.