---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.3
alternate:
  - https://catboost.ai/docs/en/concepts/python-reference_pool_set_group_weight.md
---
> **Documentation Index:** Fetch the complete configuration index at https://catboost.ai/docs/en/llms.txt

# set_group_weight

<!-- source: en/_includes/work_src/reusage-python/set_group_weight__desc.md -->
Set weights for all objects within the defined group.
<!-- endsource: en/_includes/work_src/reusage-python/set_group_weight__desc.md -->


## Method call format {#call-format}

```python
set_group_weight(group_weight)
```

## Parameters {#parameters}

### group_weight

#### Description

<!-- source: en/_includes/work_src/reusage/python__group_weight__first-sentence.md -->
The weights of all objects within the defined groups from the input data in the form of one-dimensional array-like data.

Used for calculating the final values of trees. By default, it is set to 1 for all objects in all groups.
<!-- endsource: en/_includes/work_src/reusage/python__group_weight__first-sentence.md -->

The length of this array must be equal to the number of objects in the dataset.

All weights within one group must be equal.

<!-- source: en/_includes/work_src/reusage-python/only-non-negative-values-are-supported.md -->
Only non-negative values are supported.
<!-- endsource: en/_includes/work_src/reusage-python/only-non-negative-values-are-supported.md -->

**Possible types**

- list
- numpy.ndarray
- pandas.DataFrame
- pandas.Series
- [polars.Series](https://docs.pola.rs/api/python/stable/reference/series/index.html)

**Default value**

Required parameter
