numpy解方程
2015-06-15 22:04
645 查看
Examples
Solve the system of equations 3 * x0 + x1 = 9 and x0 + 2 * x1 = 8:
>>>
Check that the solution is correct:
>>>
Solve the system of equations 3 * x0 + x1 = 9 and x0 + 2 * x1 = 8:
>>>
>>> a = np.array([[3,1], [1,2]]) >>> b = np.array([9,8]) >>> x = np.linalg.solve(a, b) >>> x array([ 2., 3.])
Check that the solution is correct:
>>>
>>> np.allclose(np.dot(a, x), b) True
相关文章推荐
- python读取mnist
- python 练习题
- python模块学习 logging
- Windows下Scrapy安装
- PyCharm简单使用介绍及注意事项
- [Python基础]007.字符串
- python学习之web2py框架
- 安装pip后命令行出错
- python模块学习 hashlib
- Python字符串的encode与decode
- Python MD5加密
- NLPIR(ICTCLAS2015)python调用接口配置
- Python正则表达式教程
- Python之PyAudio使用
- python 学习笔记(一)通过做题来熟悉python 的基本语法
- python import 同名模块
- Python
- python-sphinx 2.6.5的一个bug
- Python Twisted介绍
- [笔记] python的json模块