We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › "...so the column titles will be row 0" Huh
Page Index Toggle Pages: 1
"...so the column titles will be row 0" Huh? (Read 425 times)
"...so the column titles will be row 0" Huh?
Jul 21st, 2009, 10:23am
 
Hello, I'm still in the process of wrapping my mind around the concept of 2D arrays, and I came across this line discussing a Table class on page 32 of "Visualizing Data":

"rows and columns are numbered starting at zero, so the column titles (if any) will be row 0, and the row titles will be column 0."

Huh? This is really confusing me, so I've decided to skip it for the time being and continue using the model I have in my head, but I'd really like to know what that sentence is talking about.
Re: "...so the column titles will be row 0" Huh?
Reply #1 - Jul 21st, 2009, 10:41am
 
Without context (I don't have the book), it is a bit hard to tell exactly.
If the data is numerical, it makes little sense, so I suppose the data is made of strings.
In this case, you can think of it as an Excel table, if you are familiar with them: you can put titles of columns in the first row (eg. the names of the fields) and titles of rows in the first column (eg. can be a simple number or some ID).
Re: "...so the column titles will be row 0" Huh?
Reply #2 - Jul 21st, 2009, 7:09pm
 
I worked with this table class before. Ben wrote an easy way to use a csv file  for example. Like PhiLho said, think of it as a excel file like this one : http://www.bfi-wien.at/service/einstufungstests/einst_ex2_1_800.gif

where row 0 is "mitarbeiter, geschlecht, gehalt etc. a
and col are the names. So if you named your colums and rows, start to acess the data at 1,1 if not start at 0,0... guess thats all he is saying.
Page Index Toggle Pages: 1