def has_header(path, encoding='utf-8'):
    """
    Auto-detect if csv file has header.
    """
    from pandas import read_csv
    df0 = read_csv(path, header=None, nrows=10, skipinitialspace=True,
        encoding=encoding)
    df1 = read_csv(path, nrows=10, skipinitialspace=True, encoding=encoding)
    return tuple(df0.dtypes) != tuple(df1.dtypes)
