SCEngine

class astropy.table.SCEngine(data, row_index, unique=False)[source]

Bases: object

Fast tree-based implementation for indexing, using the sortedcontainers package.

Parameters:
data : Table

Sorted columns of the original table

row_index : Column object

Row numbers corresponding to data columns

unique : bool (defaults to False)

Whether the values of the index must be unique

Methods Summary

add(self, key, value) Add a key, value pair.
find(self, key) Find rows corresponding to the given key.
items(self) Return a list of key, data tuples.
range(self, lower, upper[, bounds]) Return row values in the given range.
remove(self, key[, data]) Remove data from the given key.
replace_rows(self, row_map) Replace rows with the values in row_map.
shift_left(self, row) Decrement rows larger than the given row.
shift_right(self, row) Increment rows greater than or equal to the given row.
sort(self) Make row order align with key order.
sorted_data(self) Return a list of rows in order sorted by key.

Methods Documentation

add(self, key, value)[source]

Add a key, value pair.

find(self, key)[source]

Find rows corresponding to the given key.

items(self)[source]

Return a list of key, data tuples.

range(self, lower, upper, bounds=(True, True))[source]

Return row values in the given range.

remove(self, key, data=None)[source]

Remove data from the given key.

replace_rows(self, row_map)[source]

Replace rows with the values in row_map.

shift_left(self, row)[source]

Decrement rows larger than the given row.

shift_right(self, row)[source]

Increment rows greater than or equal to the given row.

sort(self)[source]

Make row order align with key order.

sorted_data(self)[source]

Return a list of rows in order sorted by key.