Skip to content

Commit 6cbb8ee

Browse files
authored
Merge pull request astropy#13077 from orionlee/doc_improv_table_index
table documentation small improvement: clarify loc vs iloc
2 parents b54cc0d + b44dd9e commit 6cbb8ee

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/table/indexing.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -67,20 +67,20 @@ range of column values (*including* the bounds), or a :class:`list` or
6767

6868
>>> t = Table([(1, 2, 3, 4), (10, 1, 9, 9)], names=('a', 'b'), dtype=['i8', 'i8'])
6969
>>> t.add_index('a')
70-
>>> t.loc[2]
70+
>>> t.loc[2] # the row(s) where a == 2
7171
<Row index=1>
7272
a b
7373
int64 int64
7474
----- -----
7575
2 1
76-
>>> t.loc[[1, 4]]
76+
>>> t.loc[[1, 4]] # the row(s) where a in [1, 4]
7777
<Table length=2>
7878
a b
7979
int64 int64
8080
----- -----
8181
1 10
8282
4 9
83-
>>> t.loc[1:3]
83+
>>> t.loc[1:3] # the row(s) where a in [1, 2, 3]
8484
<Table length=3>
8585
a b
8686
int64 int64

0 commit comments

Comments
 (0)