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 " ,
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 " ,
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" ,
315315 "metadata" : {}
316316 }
317317 ]
318- }
318+ }
0 commit comments