尝试使用for循环在选项卡中每月生成

2024-05-19 06:21:43 发布

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

我在panda/python中创建了一个表,创建了一个以月为列的表,月/年将显示在该列中。我一直在尝试让它显示一个月又一个月,比如说一月,然后二月。但是我面临的问题是,它在整个专栏中一直显示同一个月和年份,正如你可以看到三月在整个专栏中出现一样。你知道吗

Image

这是我用过的for循环

    month_count = 0 

    for row_num in range (4,20):
    # TABLE 1
    vsr_tracker.write_formula(
    'B' + str(row_num), 
    '=DATE(2016,2+{0},1)'.format(month_count))
              row_num + 1))

as you can see on the screenshot that it the month march has been printed throughout the column


Tags: theinforcounttablerangepandatracker

热门问题