def infer_dtype(value):
    """get correct data type for the first element."""
    import numpy as np
    array_dtype = 'none'
    if isinstance(value, np.ndarray):
        dtype = np.ndarray
        array_dtype = value.dtype.__str__()
    elif isinstance(value, str):
        dtype = str
    elif isinstance(value, int):
        dtype = int
    elif isinstance(value, list):
        dtype = list
    elif isinstance(value, dict):
        dtype = dict
    elif isinstance(value, float):
        dtype = float
    return dtype, array_dtype
