ImportError: No module named ‘pygame’

I have installed python 3.3.2 and pygame 1.9.2a0. Whenever I try to import pygame by typing: import pygame I get following error message : I went through some of the questions related to this error but none of the solution helped. I have 64 bit machine with Win7 OS

Pandas “Can only compare identically-labeled DataFrame objects” error

Here’s a small example to demonstrate this (which only applied to DataFrames, not Series, until Pandas 0.19 where it applies to both): One solution is to sort the index first (Note: some functions require sorted indexes): Note: == is also sensitive to the order of columns, so you may have to use sort_index(axis=1): Note: This can still raise (if the index/columns aren’t … Read more

How to terminate a script?

details from the sys module documentation: sys.exit([arg]) Exit from Python. This is implemented by raising the SystemExit exception, so cleanup actions specified by finally clauses of try statements are honored, and it is possible to intercept the exit attempt at an outer level. The optional argument arg can be an integer giving the exit status (defaulting to zero), or another type of object. … Read more

Python List vs. Array – when to use?

Basically, Python lists are very flexible and can hold completely heterogeneous, arbitrary data, and they can be appended to very efficiently, in amortized constant time. If you need to shrink and grow your list time-efficiently and without hassle, they are the way to go. But they use a lot more space than C arrays, in part because … Read more