Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

160
Views
js.p5 table object: access row using a string, similar to colum header

Is there a way to access a p5.js table object row using a string - similar to accessing a table column using its header?

For example, the following csv table contains greeting and parting in different languages:

,EN, FR
greeting, hello, bonjour
parting, goodbye, aurevoir

I want to print 'hello' without using row or column index numbers, just strings:

var table = loadTable(greet-part.csv', 'csv', 'header');

print(table.get("greeting", "EN"));

I could write some more code linking 0 to 'greeting', 1 to 'parting' etc but this would become cumbersome on a large scale:

Ideas for a more elegant solution?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You could try findRow().

Not, tested, but in you case you could try something like:

table.findRow("greeting", 0).get("EN");
  • the above roughly translates to find the first occurance of "gretting" on the 1st column (index 0) and retrieve that row, then from that row retrieve the value under the "EN" column
  • 0 refers to column zero (since in your example it doesn't have a name))
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!