serialize_interval_index

serialize_interval_index(intervals)[source]

Serialize an interval index.

An interval index can be represented in two different ways:

range

If the intervals has a fixed frequency, the only necessary information is the start, end and freq parameters. This is the most compact representation.

arrays

Otherwise, all intervals are stored in left and right arrays.

Parameters:

intervals (IntervalIndex) – The intervals to serialize.

Returns:

The serialized interval index.

Return type:

dict

Raises:

ValueError – If the deserialization of the serialization is not identical to the input.