> For the complete documentation index, see [llms.txt](https://docs.sov.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sov.ai/api-reference/extensions/clustering.md).

# Clustering

**Module:** `sovai.extensions.clustering`

## Functions

### `pandas_to_array()`

```python
def pandas_to_array(df_accounting, days = None, features_select = None)
```

***

### `calculate_number_of_clusters()`

```python
def calculate_number_of_clusters(n_tickers)
```

***

### `hash_dataframe()`

```python
def hash_dataframe(df)
```

***

### `segment_series_cached()`

```python
def segment_series_cached(df_hash, features_select_hash)
```

***

### `segment_series()`

```python
def segment_series(df_accounting, features_select = None)
```

***

### `cluster()`

```python
def cluster(df_mega, features_select = None)
```

***

### `calculate_mean_last_6_months()`

```python
def calculate_mean_last_6_months(df, ticker, latest_date)
```

***

### `cluster_summary()`

```python
def cluster_summary(df_mega)
```

***

### `feature_cent()`

```python
def feature_cent(df_mega, select_features = None)
```

***

### `vizualisation_cluster()`

```python
def vizualisation_cluster(df_mega)
```

***

### `vizualisation_scatter()`

```python
def vizualisation_scatter(df_mega)
```

***

### `vizualisation_animation()`

```python
def vizualisation_animation(df_mega)
```

***
