python中带[]的for循环做什么?[]包含.csv文件

2024-09-27 00:14:07 发布

您现在位置:Python中文网/ 问答频道 /正文

我是python新手,有人能给我解释一下这段代码吗?你知道吗

TRAIN_CSV = './train1.csv' # this comtains 100 entries
TEST_CSV = './test1.csv' # this contains 50 entries
train_df = pd.read_csv(TRAIN_CSV)
test_df = pd.read_csv(TEST_CSV)

for dataset in [train_df, test_df]:   # what does this mean here
     do something

Tags: csv代码testdfreadtrainthispd

热门问题