originalEstimateSeconds
是timetracking
dict中的键,返回一个整数。我想访问该整数并附加到StoryEstimate列表。对于索引0和1,它可以工作(根据调试器)。但对于索引3,时间跟踪包含并且空的dict很好,这就是检查在那里的原因。但是,PyCharm仍然会返回
ValueError: Length of values does not match length of index.
endResult
和df
是pandas数据帧。
StoryEstimate是
StoryEstimate = []
for i, r in endResult.iterrows():
timetracking = endResult['issues'][i]['fields']['timetracking']
if 'originalEstimateSeconds' in timetracking:
StoryEstimate.append(estimate)
df['Story Actual Hrs'] = StoryEstimate