From 44e235b5caae10ce5b2b937aa05435b3f598900b Mon Sep 17 00:00:00 2001 From: Justin Kiggins Date: Tue, 24 Apr 2018 06:29:56 -0700 Subject: [PATCH] :bug: uses six.zip for py2/3 compat better --- neuroglia/datasets/crcns.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/neuroglia/datasets/crcns.py b/neuroglia/datasets/crcns.py index dae37e2..6272dc5 100644 --- a/neuroglia/datasets/crcns.py +++ b/neuroglia/datasets/crcns.py @@ -3,7 +3,6 @@ import os import tarfile from collections import namedtuple -from itertools import izip import requests import pandas as pd import numpy as np @@ -11,6 +10,11 @@ from sklearn.utils import Bunch from .utils import get_neuroglia_data_home +try: + from itertools import izip as zip +except ImportError: # must be python3 + pass + URL = 'https://portal.nersc.gov/project/crcns/download/index.php' @@ -127,7 +131,7 @@ def read_spikes_from_tar(f): ts = f.extractfile(timestamps) clu = f.extractfile(clusters) - for frame,cluster in izip(ts.readlines(),clu.readlines()): + for frame,cluster in zip(ts.readlines(),clu.readlines()): if int(cluster)>1: spike = dict( time=float(frame) / SPIKES_HZ,