简体   繁体   中英

Retrieving the Nth value of a given column in a table

I have a table containing the following three columns:

a                 b                 c                
----------------- ----------------- -----------------
0.133979108417407 1.754130915272981 1.42329662386328 
0.668288746615872 0.734417136292905 0.732997396495193
0.862356088589877 1.797701210249215 0.393919392488897
0.629761615302414 0.627890981268138 0.500648534856737
0.001629136269912 0.623473873827606 1.101053179707378
0.359894326189533 1.729495922103524 0.568989174440503
0.791510772192851 0.435095694381744 1.597348631359637
0.708041025325656 0.219414299819618 1.387293450068682

Now, if I want to access the 3rd value of column b , how could I do?

You can achieve this by specify column name and the row number, such tb["myColName"][0] ; try the following script:

tb=table(rand(1.,50) as a,rand(2.,50) as b,rand(2.,50) as c)
tb[`b][2]
print(tb[`b][2])

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM