# 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/9d7aa3a91b5cf874833976c303629c90a90e61f4/libs/weaviate/langchain_weaviate/_math.py#L69)