Python in use-math (updated Feb 6, 2018)
- the use of
matplotlib.pyplot
is not hard to learn, which can be find on its official website. One of the common practices isimport matplotlib as plt x = np.linspace(start,end,50) plt.plot(x,fun(x),ro) plt.show
and this returns a graph of the function
-
any class that has a call method can be called with
instance_name()
just like a function - after importing the built-in module
logging
, the log-level can be altered to determine which kinds of messages shall be shown and which shall not. E.g.:logging.getLogger().setLevel(0)
Another way is just print it out in a log-style, likeprint("[LOG] under current iteration: {}".format(summation))
- do not start calculating until it’s called, so-called lazy mode
Source file avaliable at my github repo and ‘dalao’ smdsbz’s repo