# GROUP\_BY\_DEVICE

### Description

Converts *vector* to a *grouped vector* by grouping by devices. I.e. each device has its own list of events.

### GROUP\_BY\_DEVICE(Vector\<Event>)

```java
GROUP_BY_DEVICE(vector: Vector<Event>): GroupedVector<Device,Event>
```

Groups the events in the given vector by deviceId.

#### Parameters

<table><thead><tr><th width="138">Parameter</th><th>Description</th></tr></thead><tbody><tr><td>vector</td><td>A vector of type Event</td></tr></tbody></table>

#### Returns

A GroupedVector of type \<Device,Event>.

### Examples

Group the events in the GridPowerConsumption vector by device id.

```java
GROUP_BY_DEVICE($GridPowerConsumption)
```
