Skip to content

Commit e6d2b80

Browse files
committed
fix python 2 compatibility iterating over a pandas Series
1 parent 294367f commit e6d2b80

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

nipype/utils/draw_gantt_chart.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,8 +364,13 @@ def draw_resource_bar(start_time, finish_time, time_series, space_between_minute
364364
space_between_minutes = space_between_minutes / scale
365365

366366
# Iterate through time series
367+
if PY3:
368+
ts_items = time_series.items()
369+
else:
370+
ts_items = time_series.iteritems()
371+
367372
ts_len = len(time_series)
368-
for idx, (ts_start, amount) in enumerate(time_series.items()):
373+
for idx, (ts_start, amount) in enumerate(ts_items):
369374
if idx < ts_len-1:
370375
ts_end = time_series.index[idx+1]
371376
else:

0 commit comments

Comments
 (0)