summaryrefslogtreecommitdiff
path: root/numpy/lib/index_tricks.py
diff options
context:
space:
mode:
authorczgdp1807 <gdp.1807@gmail.com>2021-09-03 12:17:26 +0530
committerczgdp1807 <gdp.1807@gmail.com>2021-09-03 12:17:26 +0530
commit781d0a7ac61ce007e65abcd4e30f2181e729ae61 (patch)
treef45f38a246bcefbca9ca8a08bd8ba55cbc6cdb15 /numpy/lib/index_tricks.py
parentb341e4c3249817d2e14ddf71aa850a8a896b9303 (diff)
parent2ae1e068710174dc57b5ba5ad688517608efcf26 (diff)
downloadnumpy-781d0a7ac61ce007e65abcd4e30f2181e729ae61.tar.gz
resolved conflicts
Diffstat (limited to 'numpy/lib/index_tricks.py')
-rw-r--r--numpy/lib/index_tricks.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/numpy/lib/index_tricks.py b/numpy/lib/index_tricks.py
index 8d1b6e5be..2a4402c89 100644
--- a/numpy/lib/index_tricks.py
+++ b/numpy/lib/index_tricks.py
@@ -149,9 +149,9 @@ class nd_grid:
try:
size = []
typ = int
- for k in range(len(key)):
- step = key[k].step
- start = key[k].start
+ for kk in key:
+ step = kk.step
+ start = kk.start
if start is None:
start = 0
if step is None:
@@ -161,19 +161,19 @@ class nd_grid:
typ = float
else:
size.append(
- int(math.ceil((key[k].stop - start)/(step*1.0))))
+ int(math.ceil((kk.stop - start) / (step * 1.0))))
if (isinstance(step, (_nx.floating, float)) or
isinstance(start, (_nx.floating, float)) or
- isinstance(key[k].stop, (_nx.floating, float))):
+ isinstance(kk.stop, (_nx.floating, float))):
typ = float
if self.sparse:
nn = [_nx.arange(_x, dtype=_t)
for _x, _t in zip(size, (typ,)*len(size))]
else:
nn = _nx.indices(size, typ)
- for k in range(len(size)):
- step = key[k].step
- start = key[k].start
+ for k, kk in enumerate(key):
+ step = kk.step
+ start = kk.start
if start is None:
start = 0
if step is None:
@@ -181,7 +181,7 @@ class nd_grid:
if isinstance(step, (_nx.complexfloating, complex)):
step = int(abs(step))
if step != 1:
- step = (key[k].stop - start)/float(step-1)
+ step = (kk.stop - start) / float(step - 1)
nn[k] = (nn[k]*step+start)
if self.sparse:
slobj = [_nx.newaxis]*len(size)