|
36 | 36 |
|
37 | 37 | import math |
38 | 38 |
|
39 | | -try: |
40 | | - xrange |
41 | | -except: |
42 | | - from past.builtins import xrange |
43 | 39 |
|
44 | 40 | import numpy as np |
45 | 41 | import pandas as pd |
|
50 | 46 | import matplotlib.transforms as mxfms |
51 | 47 | import matplotlib.colors as mcolors |
52 | 48 | import skimage.transform |
53 | | -from six import iteritems |
54 | 49 |
|
55 | 50 |
|
56 | 51 | DEFAULT_COLOR_MAP = LinearSegmentedColormap.from_list('default', [[.7,0,.7,0.0],[.7,0,0,1]]) |
@@ -178,7 +173,7 @@ def build_hex_pack(n): |
178 | 173 | mag = 1 |
179 | 174 | sign = 1 |
180 | 175 |
|
181 | | - for j in xrange(N-1): |
| 176 | + for j in range(N-1): |
182 | 177 | x += v[0] * mag * sign |
183 | 178 | y += v[1] * mag * sign |
184 | 179 | mag += 1 |
@@ -277,7 +272,7 @@ def make_pincushion_plot(data, trials, on, nrows, ncols, clim=None, color_map=No |
277 | 272 | color_map = LSN_ON_COLOR_MAP if on else LSN_OFF_COLOR_MAP |
278 | 273 |
|
279 | 274 | ax = plt.gca() |
280 | | - for (col,row,on_state), sweeps in iteritems(trials): |
| 275 | + for (col,row,on_state), sweeps in trials.items(): |
281 | 276 | if on_state != on: |
282 | 277 | continue |
283 | 278 |
|
@@ -477,7 +472,7 @@ def plot(self, category_data, |
477 | 472 | df = pd.DataFrame({ 'category': category_data }) |
478 | 473 | gb = df.groupby(['category']) |
479 | 474 |
|
480 | | - for category, trials in iteritems(gb.groups): |
| 475 | + for category, trials in gb.groups.items(): |
481 | 476 | idx = self.cat_idx_map[category] |
482 | 477 | order = np.argsort(data[trials])[::-1] |
483 | 478 | trial_order = np.array(trials)[order] |
@@ -714,7 +709,7 @@ def plot(self, |
714 | 709 |
|
715 | 710 | gb = df.groupby(['group', 'angle', 'r']) |
716 | 711 |
|
717 | | - for (group, angle, r), trials in iteritems(gb.groups): |
| 712 | + for (group, angle, r), trials in gb.groups.items(): |
718 | 713 | responses = np.sort(data[trials])[::-1] |
719 | 714 |
|
720 | 715 | circles = spiral_trials_polar(self.r_radius_map[r], |
|
0 commit comments