---
name: spector
description: >
  Sparse vectors. Use when writing Python code that uses the spector package.
license: Apache-2.0
compatibility: Requires Python >=3.11.
---

# spector

Sparse vectors.

## Installation

```bash
pip install spector
```

## API overview

### Classes

- `indices`: A sparse boolean array, i.e., set of indices
- `vector`: A sparse array of index keys mapped to numeric values
- `matrix`: A sparse vector of vectors

### Functions

- `groupby`: Generate unique keys with associated groups

## Resources

- [Full documentation](https://coady.github.io/spector/)
- [llms.txt](llms.txt) — Indexed API reference for LLMs
- [llms-full.txt](llms-full.txt) — Comprehensive documentation for LLMs
