pathway.stdlib.indexing package

class pw.indexing.DataIndex

[source]

class pw.indexing.SortedIndex

[source]

clear()None. Remove all items from D.

copy()a shallow copy of D

fromkeys(value=None, /)

Create a new dictionary with keys from iterable and values set to value.

get(key, default=None, /)

Return the value for key if key is in the dictionary, else default.

items()a set-like object providing a view on D's items

keys()a set-like object providing a view on D's keys

pop(k, )v, remove specified key and return the corresponding value.

If the key is not found, return the default if given; otherwise, raise a KeyError.

popitem()

Remove and return a (key, value) pair as a 2-tuple.

Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.

setdefault(key, default=None, /)

Insert key with a value of default if key is not in the dictionary.

Return the value for key if key is in the dictionary, else default.

update(**F)None. Update D from dict/iterable E and F.

If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

values()an object providing a view on D's values

class pw.indexing.VectorDocumentIndex(data_documents, data, embedder, n_dimensions, n_or=20, n_and=10, bucket_length=10.0, distance_type='euclidean', metadata=None)

[source]

pw.indexing.retrieve_prev_next_values(ordered_table, value=None)

sourceRetrieve, for each row, a pointer to the first row in the ordered_table that contains a non-“None” value, based on the orders defined by the prev and next columns.

  • Parameters
    • ordered_table (pw.Table) – Table with three columns: value, prev, next. The prev and next columns contain pointers to other rows.
    • value (Optional[pw.ColumnReference]) – Column reference pointing to the column containing values. If not provided, assumes the column name is “value”.
  • Returns
    pw.Table
    Table with two columns: prev_value and next_value.
      The prev_value column contains the values of the first row, according                   to the order defined by the column next, with a value different from None.
      The next_value column contains the values of the first row, according                   to the order defined by the column prev, with a value different from None.
    

Submodules

pathway.stdlib.indexing.data_index module

class pw.indexing.data_index.DataIndex

[source]

class pw.indexing.data_index.VectorDocumentIndex(data_documents, data, embedder, n_dimensions, n_or=20, n_and=10, bucket_length=10.0, distance_type='euclidean', metadata=None)

[source]
## pathway.stdlib.indexing.sorting module

class pw.indexing.sorting.Aggregate

[source]

class pw.indexing.sorting.BinsearchOracle

[source]

class pw.indexing.sorting.Candidate

[source]

class pw.indexing.sorting.ComparisonRet

[source]

class pw.indexing.sorting.Hash

[source]

class pw.indexing.sorting.Instance

[source]

class pw.indexing.sorting.Key

[source]

class pw.indexing.sorting.LeftRight

[source]

class pw.indexing.sorting.Node

[source]

class pw.indexing.sorting.Parent

[source]

class pw.indexing.sorting.PrefixSumOracle

[source]

class pw.indexing.sorting.PrevNext

[source]

class pw.indexing.sorting.SortedIndex

[source]

clear()None. Remove all items from D.

copy()a shallow copy of D

fromkeys(value=None, /)

Create a new dictionary with keys from iterable and values set to value.

get(key, default=None, /)

Return the value for key if key is in the dictionary, else default.

items()a set-like object providing a view on D's items

keys()a set-like object providing a view on D's keys

pop(k, )v, remove specified key and return the corresponding value.

If the key is not found, return the default if given; otherwise, raise a KeyError.

popitem()

Remove and return a (key, value) pair as a 2-tuple.

Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.

setdefault(key, default=None, /)

Insert key with a value of default if key is not in the dictionary.

Return the value for key if key is in the dictionary, else default.

update(**F)None. Update D from dict/iterable E and F.

If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

values()an object providing a view on D's values

class pw.indexing.sorting.Value

[source]

pw.indexing.sorting.retrieve_prev_next_values(ordered_table, value=None)

sourceRetrieve, for each row, a pointer to the first row in the ordered_table that contains a non-“None” value, based on the orders defined by the prev and next columns.

  • Parameters
    • ordered_table (pw.Table) – Table with three columns: value, prev, next. The prev and next columns contain pointers to other rows.
    • value (Optional[pw.ColumnReference]) – Column reference pointing to the column containing values. If not provided, assumes the column name is “value”.
  • Returns
    pw.Table
    Table with two columns: prev_value and next_value.
      The prev_value column contains the values of the first row, according                   to the order defined by the column next, with a value different from None.
      The next_value column contains the values of the first row, according                   to the order defined by the column prev, with a value different from None.