python SyntaxError: invalid syntax %matplotlib inline

if you are not using Jupyter IPython notebook, just comment out (or delete) the line, everything will work fine and a separate plot window will be opened if you are running your python script from the console. However, if you are using Jupyter IPython notebook, the very first python code cell in your notebook should … Read more

Is there a built-in function to print all the current properties and values of an object?

You are really mixing together two different things. Use dir(), vars() or the inspect module to get what you are interested in (I use __builtins__ as an example; you can use any object instead). Print that dictionary however fancy you like: or Pretty printing is also available in the interactive debugger as a command:

RuntimeWarning: divide by zero encountered in log

numpy.log10(prob) calculates the base 10 logarithm for all elements of prob, even the ones that aren’t selected by the where. If you want, you can fill the zeros of prob with 10**-10 or some dummy value before taking the logarithm to get rid of the problem. (Make sure you don’t compute prob > 0.0000000001 with dummy values, though.)