import itertools string.ascii_letters # 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' string.ascii_lowercase # 'abcdefghijklmnopqrstuvwxyz' string.ascii_uppercase # 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' col1 = itertools.cycle(string.ascii_lowercase) col2 = itertools.cycle([1, 2]) n = 1000 df = pd.DataFrame({ 'col1': [next(col1) for _ in range(n)], 'col2': [next(col2) for _ in range(n)]

参考链接: pandas 生成任意行循环取值数据