Why Python does my head in #458
-
image_slice = numpy_image[150:220, 130:250]
When slicing a numpy image, the bounds are inclusive and indexing starts from 1.
array_slice = array[0:2]
When slicing a Python array the end bound is exclusive and indexing starts from 0. What could possibly go wrong?
cheers Chris Maunder
VB's
WithEvents
is jealous.Jeremy Falcon
-
Exactly the same with the functions in Transact-SQL. These people don't know their zeroes. You need to be careful in the Muggle World.
Advertise here – minimum three posts per day are guaranteed.
I think T-SQL is at least consistent. And any T-SQL functions which use an index of a character in a string should be avoided anyway, for performance reasons.
-
image_slice = numpy_image[150:220, 130:250]
When slicing a numpy image, the bounds are inclusive and indexing starts from 1.
array_slice = array[0:2]
When slicing a Python array the end bound is exclusive and indexing starts from 0. What could possibly go wrong?
cheers Chris Maunder
-
image_slice = numpy_image[150:220, 130:250]
When slicing a numpy image, the bounds are inclusive and indexing starts from 1.
array_slice = array[0:2]
When slicing a Python array the end bound is exclusive and indexing starts from 0. What could possibly go wrong?
cheers Chris Maunder
-
image_slice = numpy_image[150:220, 130:250]
When slicing a numpy image, the bounds are inclusive and indexing starts from 1.
array_slice = array[0:2]
When slicing a Python array the end bound is exclusive and indexing starts from 0. What could possibly go wrong?
cheers Chris Maunder
I have to ask ! why are you using Python ?
Life should not be a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!" - Hunter S Thompson - RIP
-
image_slice = numpy_image[150:220, 130:250]
When slicing a numpy image, the bounds are inclusive and indexing starts from 1.
array_slice = array[0:2]
When slicing a Python array the end bound is exclusive and indexing starts from 0. What could possibly go wrong?
cheers Chris Maunder
You will recall the Mars Climate Orbital failed because engineers at JPL assumed the units provided by Lockheed Martin were metric when in fact they were "English" meaning USA . incredible . apparently the piece of paper w/ the data did not bother to include "inches" or "s" at the end of the numbers and apparently no one bothered to inquire is this bare naked number in meters or feet or squared pickles .
-
You will recall the Mars Climate Orbital failed because engineers at JPL assumed the units provided by Lockheed Martin were metric when in fact they were "English" meaning USA . incredible . apparently the piece of paper w/ the data did not bother to include "inches" or "s" at the end of the numbers and apparently no one bothered to inquire is this bare naked number in meters or feet or squared pickles .
I remember that well and I still find that incomprehensible. (a) that no engineer demanded to see units, or even questioned their omission, (b) that units weren't provided in the first place, and (c) that an international aerospace company (or any international engineering company) would not be using SI units. Still shaking my head after all these years
cheers Chris Maunder
-
I have to ask ! why are you using Python ?
Life should not be a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!" - Hunter S Thompson - RIP
Just a [small little project](https://www.codeproject.com/AI/docs/) we're playing with :)
cheers Chris Maunder
-
Just a [small little project](https://www.codeproject.com/AI/docs/) we're playing with :)
cheers Chris Maunder
I thought you were a C++ man - I'm not a Python fan.
Life should not be a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!" - Hunter S Thompson - RIP
-
This is why a language needs to be designed by a committee. :D
Yep. A Giraffe is a horse designed by a committee.