<jupyter_start><jupyter_text>Examples indices<jupyter_code>import numpy as np
from spector import indices

ind = indices([0, 2])
ind
np.array(ind)
1 in ind
ind.add(1)
ind.todense()
indices.fromdense([True, False, True])<jupyter_output><empty_output><jupyter_text>vector<jupyter_code>from spector import vector

vec = vector({0: 1.0, 2: 2.0, 4: 1.0})
vec
np.array(vec)
vec[2] += 1.0
vec[2]
vec.sum()
vec.todense()
vector.fromdense([1, 0, 2, 0, 1])<jupyter_output><empty_output><jupyter_text>matrix<jupyter_code>from spector import matrix

mat = matrix({0: {1: 2.0}})
mat
mat.row, mat.col, mat.data<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16134185303514376, 'fraction_numerical': 0.04153354632587859, 'mean_word_length': 7.038461538461538, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '493322', 'license': 'Apache-2.0', 'n_tokens_mistral': 282, 'n_tokens_neox': 266, 'n_words': 55, 'path': 'docs/examples.ipynb', 'repo_name': 'coady/spector', 'size': '626'}