黃河泉 发表于 2019-1-6 07:44 
你若要问程序,永远附上相关资料;若附上资料,永远用 dataex 印出资料。
1. 先 ssc install dataex (并见 ...
谢谢黄老师,是这样
>>> list1 = ['a', 'b', 'c', 'd']
>>> list2 = ['apple', 'boy', 'cat', 'dog']
>>> for x, y in zip(list1, list2):
print(x, 'is', y)
# 输出
a is apple
b is boy
c is cat
d is dog
这个是python中for循环的一种形式,具体的名字我也不太懂,姑且叫配对循环吧,stata里面可以这样子配对循环吗?
一般的是foreach i in ...{}
那stata有没有那种 foreach i j in 遍历对象1 遍历对象2{}这样的设置呢