Skip to content

Commit

Permalink
merge develop -Dorg -Ssuccess-only: PR 6260 (Add slice examples for r…
Browse files Browse the repository at this point in the history
…eading data from Omero Tables)
  • Loading branch information
snoopycrimecop committed Jan 19, 2021
2 parents 3922c4c + 451f8a0 commit 1d8aa84
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions examples/Training/python/Tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,17 @@
print(" ", v)


# Get data from every column of the specified rows using slice
# ============================================================
row_numbers = [3, 5, 7]
print("\nGet All Data for rows with slice: ", row_numbers)
data = open_table.slice(range(len(open_table.getHeaders())), row_numbers)
for col in data.columns:
print("Data for Column: ", col.name)
for v in col.values:
print(" ", v)


# Get data from specified columns of specified rows
# =================================================
col_numbers = [1]
Expand All @@ -116,6 +127,21 @@
print(" ", v)


# Get data from specified columns of specified rows using slice
# =============================================================
col_numbers = [1]
start = 3
stop = 7
print("\nGet Data for cols: ", col_numbers,
" and between rows: ", start, "-", stop,
" with slice")
data = open_table.slice(col_numbers, range(start, stop))
for col in data.columns:
print("Data for Column: ", col.name)
for v in col.values:
print(" ", v)


# Query the table for rows where the 'Uid' is in a particular range
# =================================================================
query_rows = open_table.getWhereList(
Expand Down

0 comments on commit 1d8aa84

Please sign in to comment.