# tfdv.compare_slices

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/data-validation/blob/v1.16.1/tensorflow_data_validation/utils/display_util.py#L544-L564) |

Compare statistics of two slices using Facets.

    tfdv.compare_slices(
        statistics: statistics_pb2.DatasetFeatureStatisticsList,
        lhs_slice_key: Text,
        rhs_slice_key: Text
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `statistics` | A DatasetFeatureStatisticsList protocol buffer. |
| `lhs_slice_key` | Slice key of the first slice. |
| `rhs_slice_key` | Slice key of the second slice. |

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `ValueError` | If the input statistics proto does not have the specified slice statistics. |

<br />