添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
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 生成任意行循环取值数据