python 'verbose' results

I’m missing something here on Python:

n = op(‘null4’)
##all = n[0,0],n[0,1]
print ([n.rows()])
##print (all)

this produces a ‘verbose’ response:

python >>>
[[[ val:0.005 cell:(0, 0) owner:/project1/null4, val:0.005 cell:(0, 1) owner:/project1/null4]]]
python >>>

whereas I am hoping for the result:

0.005 0.005

What am I missing?

That returns the cell class which has a ton of information, and you want the value of each cell.

What you can do is iterate through the number of rows, and then print the value.

``````for i in n.cols():
print(i[0])``````

hmm, thanks.
I shouldve been more specific. I have this code snippet I found which pleases me:

y = [2, 4, …]
m = max(y)
p = y.index(m)
print (m, p)

but I wish to replace the values of y with values of a DAT’s cells(is this what you would call ‘pseudocode’?):

n = op(‘nullDAT4’)
y = [n[0,0], n[0,1], …]

or something along those lines

woot!

I think I got it. Might be ugly , but it’s MINE!

n = op(‘null4’)
e = n.cell(0,0)
u = n.cell(0,1)
y = [e,u]
m = max(y)
p = y.index(m)
print (m, p)

You might also try a list comprehension:

n = op(‘null4’)
y = [int(c) for c in n.row(0)]

Thks Rob,
Looks like that would cover any future expansion/ contractions of ‘y’.
Thks for the helps!