sklearn.utils.check_consistent_length

sklearn.utils.check_consistent_length(*arrays)[source]

Check that all arrays have consistent first dimensions.

Checks whether all objects in arrays have the same shape or length.

Parameters:
*arrayslist or tuple of input objects.

Objects that will be checked for consistent length.

Examples

>>> from sklearn.utils.validation import check_consistent_length
>>> a = [1, 2, 3]
>>> b = [2, 3, 4]
>>> check_consistent_length(a, b)