ValueError:值的长度与索引的长度不匹配

时间:2017-06-08 14:24:53

标签: python pandas

originalEstimateSecondstimetracking dict中的键,返回一个整数。我想访问该整数并附加到StoryEstimate列表。对于索引0和1,它可以工作(根据调试器)。但对于索引3,时间跟踪包含并且空的dict很好,这就是检查在那里的原因。但是,PyCharm仍然会返回

ValueError: Length of values does not match length of index.

endResultdf是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

0 个答案:

没有答案