¡@

Home 

python Programming Glossary: surprise

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

http://stackoverflow.com/questions/10062954/valueerror-the-truth-value-of-an-array-with-more-than-one-element-is-ambiguous

mask r dt startdate and r dt enddate selected r mask To my surprise I got the rather cryptic error message ValueError The truth..

Python: Reducing memory usage of dictionary

http://stackoverflow.com/questions/10264874/python-reducing-memory-usage-of-dictionary

int second #or float second return data To much of my surprise while the total size of the files in disk is about 21 mb when..

class variables is shared across all instances in python?

http://stackoverflow.com/questions/11040438/class-variables-is-shared-across-all-instances-in-python

code class A var 0 list def __init__ self pass Here to my surprise var and list are kinda global variable it is shared across all..

benchmarks: does python have a faster way of walking a network folder?

http://stackoverflow.com/questions/13138160/benchmarks-does-python-have-a-faster-way-of-walking-a-network-folder

Vbscript 124 seconds That Vbscript would be slowest was no surprise but I can't explain the difference between Ruby and Python...

Dictionary vs Object - which is more efficient and why?

http://stackoverflow.com/questions/1336791/dictionary-vs-object-which-is-more-efficient-and-why

real 0m12.262s using namedtuple So yes not really a surprise using __slots__ is a performance optimization. Using a named..

When does Django look up the primary key of foreign keys?

http://stackoverflow.com/questions/13631211/when-does-django-look-up-the-primary-key-of-foreign-keys

the_hobbit rating 8.5 the_hobbit.save my_rating.save To my surprise it still raised an IntegrityError complaining that I was trying..

Difference between __str__ and __repr__ in Python

http://stackoverflow.com/questions/1436703/difference-between-str-and-repr-in-python

Default implementation is useless This is mostly a surprise because Python ™s defaults tend to be fairly useful. However..

Python append() vs. + operator on lists, why do these give different results?

http://stackoverflow.com/questions/2022031/python-append-vs-operator-on-lists-why-do-these-give-different-results

of the array module in Python in February 1993. it might surprise you but arrays were added way after sequences and lists came..

What do (lambda) function closures capture in Python?

http://stackoverflow.com/questions/2295290/what-do-lambda-function-closures-capture-in-python

the second lambda function with 3 as a parameter. To my surprise the output was 6 I expected a 4. My reasoning was in Python..

Python integer incrementing with ++ [duplicate]

http://stackoverflow.com/questions/2632677/python-integer-incrementing-with

allow incrementing with double plus signs number To my surprise I can't find anything about this in the Python docs. Must I..

Why “is” keyword has different behavior when there is dot in the string?

http://stackoverflow.com/questions/2858603/why-is-keyword-has-different-behavior-when-there-is-dot-in-the-string

looking for it becomes very fast of course . And indeed surprise surprise... z intern x id z 2484672 ... x has been intern ed.. for it becomes very fast of course . And indeed surprise surprise... z intern x id z 2484672 ... x has been intern ed the very..

Why doesn't finite repetition in lookbehind work in some flavors?p

http://stackoverflow.com/questions/3159524/why-doesnt-finite-repetition-in-lookbehind-work-in-some-flavorsp

i have tested 10 10 10 11 12 13 etc... But to my surprise ^ d d d 1 2 worked. But the d 1 2 should also match if d d did..

How does Python's super() work with multiple inheritance?

http://stackoverflow.com/questions/3277367/how-does-pythons-super-work-with-multiple-inheritance

instead of falling back to a behaviour which might surprise the user. Edited to add example of an ambiguous MRO class First..

RGB to HSV conversion using PIL

http://stackoverflow.com/questions/4554627/rgb-to-hsv-conversion-using-pil

a matrix would look like. In a way this doesn't really surprise me based on all the similar non matrix procedural implementations..

Python generator vs callback function

http://stackoverflow.com/questions/5704220/python-generator-vs-callback-function

ran comparison tests between the two versions and to my surprise I found the generator version ran 5 times slower than the callback..

Passing Numpy arrays to a C function for input and output

http://stackoverflow.com/questions/5862915/passing-numpy-arrays-to-a-c-function-for-input-and-output

I call the function again I get a segfault. Which doesn't surprise me I really don't know what I'm doing here. Can anyone point..

Python: Source install of 2.6 and mercurial, bz2 error

http://stackoverflow.com/questions/5873544/python-source-install-of-2-6-and-mercurial-bz2-error

shared machine Python installs fine but can't find bz2 no surprise and easy_install doesn't help. Anyone got any ideas what I'm..

Numpy vs Cython speed

http://stackoverflow.com/questions/7799977/numpy-vs-cython-speed

then I rewrote it using loops for the numpy part. To my surprise the code based on loops was much faster 8x . I cannot post the..

Checking for NaN presence in a container

http://stackoverflow.com/questions/9904699/checking-for-nan-presence-in-a-container

NaN in set_ # True hash NaN is some fixed integer so no surprise here print hash 0 # 0 print hash NaN # 0 set_ 1 2 0 print NaN..