# cdist

> **Function** in `langchain_weaviate`

📖 [View in docs](https://reference.langchain.com/python/langchain-weaviate/_math/cdist)

Compatibility wrapper. Returns pairwise distances between rows of X and Y.
Uses simsimd.cdist if available, else SciPy, else NumPy fallback.

## Signature

```python
cdist(
    X: np.ndarray,
    Y: np.ndarray,
    metric: str = 'cosine',
) -> np.ndarray
```

---

[View source on GitHub](https://github.com/langchain-ai/langchain-weaviate/blob/721bbe456a2111ea7a4459785e477a871b134bf5/libs/weaviate/langchain_weaviate/_math.py#L74)