def __init__(self, fields):
        """
        :param fields: An ordered dictionary in which a key is the name of an attribute and a value is a list of the values of the instances in the dataset.

        :return: A Dataset object
        """
        self.fields = OrderedDict(fields)
        length = None
        length_field = None
        for name, d in fields.items():
            if length is None:
                length = len(d)
                length_field = name
            else:
                if len(d) != length:
                    raise InvalidFieldsException('field {} has length {} but field {} has length {}'.format(length_field, length, name, len(d)))
def __init__ ( self , fields ) : self . fields = OrderedDict ( fields ) length = None length_field = None for name , d in fields . items ( ) : if length is None : length = len ( d ) length_field = name else : if len ( d ) != length : raise InvalidFieldsException ( 'field {} has length {} but field {} has length {}' . format ( length_field , length , name , len ( d ) ) )
:param fields: An ordered dictionary in which a key is the name of an attribute and a value is a list of the values of the instances in the dataset.

        :return: A Dataset object