Python 科学计算

  • 手动安装Python库
  • Python 科学计算做好在Python2.7的环境下
  • One way of getting a handle on the scientific computation tools in Python is to take a look at the following online resources

安装python(x,y)

  • 安装前,会提示卸载系统现有的Python
  • 安装的时候,选择Select the type of install: Full(完全安装),这样比较省时与方便。
  • 附带安装Python 2
  • Shortcuts:启动各种应用程序
  • Documentation:打开各个软件包的文档
  • About:查看所安装的程序库的版本信息
  • 依次在Spyder、Applications、Interactive consoles中选择none(IDE)、IPython Qt Console、Python,点击界面中”绿色勾”图标的选项,即可开启IPython运行环境

Sublime 环境配置

  • 将Python27.sublime-build改为
    {
        "cmd": ["C:\\Python27\\Scripts\\ipython.exe", "$file"] }

一个简单的画图,测试能不能输出图形

    import matplotlib.pyplot as plt
    plt.plot([1,2,3,4])
    plt.show()
    print "hello world"

Numpy:ufunc frompyfunc 矩阵运算

  • 官方教程
    import numpy as np  # 默认都这样写
    def func(c, c0, hc):
        def trifunc(x):
            x = x - int(x)
            if x >= c:
                r = 0.0
            elif x < c0:
                r = x / c0 * hc
            else:
                r = ((c - x) / (c - c0)) * hc
            return r
        return np.frompyfunc(trifunc, 1, 1)  # 1, 1表示1个输入,1个输出
    x = np.linspace(0, 2, 100)
    #funcs = np.frompyfunc(lambda x:func(x, 0.6, 0.4, 1.0), 1, 1)
    #y = funcs(x)
    y = func(0.6, 0.4, 1.0)(x)
    print y.astype(np.float64)  # 类型转换

Scipy: 非线性方程组 数值积分 常微分方程组

  • 官方教程

Matplotlib Mql_toolkits:图形绘制

  • 官方教程

Pandas:数据筛选过滤 字符串操作 散点图 直方图

  • 官方教程

SymPy

  • 官方教程
  • 中文教程

你可能感兴趣的:(Python 科学计算)