Skip to content

Commit 22008e9

Browse files
authored
Update Rebinning.ipynb (#55)
Fixing typo and update syntaxe: the print could not print because of missing brackets, you can no longer concatenate a list with a range in python 3.x
1 parent d0ef293 commit 22008e9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ipython/Rebinning.ipynb

+6-6
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,9 @@
239239
" old = n.array( a.shape )\n",
240240
" ndims = len( a.shape )\n",
241241
" if len( newdims ) != ndims:\n",
242-
" print \"[congrid] dimensions error. \" \\\n",
242+
" print(\"[congrid] dimensions error. \" \\\n",
243243
" \"This routine currently only support \" \\\n",
244-
" \"rebinning to the same number of dimensions.\"\n",
244+
" \"rebinning to the same number of dimensions.\")\n",
245245
" return None\n",
246246
" newdims = n.asarray( newdims, dtype=float ) \n",
247247
" dimlist = []\n",
@@ -268,7 +268,7 @@
268268
" mint = scipy.interpolate.interp1d( olddims[-1], a, kind=method )\n",
269269
" newa = mint( dimlist[-1] )\n",
270270
"\n",
271-
" trorder = [ndims - 1] + range( ndims - 1 )\n",
271+
" trorder = [ndims - 1] + list(range( ndims - 1 ))\n",
272272
" for i in range( ndims - 2, -1, -1 ):\n",
273273
" newa = newa.transpose( trorder )\n",
274274
"\n",
@@ -302,9 +302,9 @@
302302
" newa = scipy.ndimage.map_coordinates(a, newcoords)\n",
303303
" return newa\n",
304304
" else:\n",
305-
" print \"Congrid error: Unrecognized interpolation type.\\n\", \\\n",
305+
" print(\"Congrid error: Unrecognized interpolation type.\\n\", \\\n",
306306
" \"Currently only \\'neighbour\\', \\'nearest\\',\\'linear\\',\", \\\n",
307-
" \"and \\'spline\\' are supported.\"\n",
307+
" \"and \\'spline\\' are supported.\")\n",
308308
" return None"
309309
],
310310
"language": "python",
@@ -315,4 +315,4 @@
315315
"metadata": {}
316316
}
317317
]
318-
}
318+
}

0 commit comments

Comments
 (0)