def infer_dtype(data):
    """ Infer the type of data provided

    Args
    -----
    data (iterable):

    Returns
    --------
    type

    """
    types = list(set(map(type, data)).difference({type(None)}))
    if len(types) == 0:
        dtype = type(None)
    elif len(types) == 1:
        dtype = types[0]
    else:
        msg = 'Multiple types detected in input: {}'
        raise ValueError(msg.format(map(lambda x: x.__name__, types)))
    return dtype
