Python in use-math (updated Feb 6, 2018)

  1. the use of matplotlib.pyplot is not hard to learn, which can be find on its official website. One of the common practices is
    import 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

  2. any class that has a call method can be called with instance_name() just like a function

  3. 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, like
    print("[LOG] under current iteration: {}".format(summation))
    
  4. do not start calculating until it’s called, so-called lazy mode

Source file avaliable at my github repo and ‘dalao’ smdsbz’s repo