概述
文章
- 基础篇
- 进阶篇
- 其他篇
用户指南
NumPy 参考手册
- 数组对象
- 常量
- 通函数(ufunc)
- 常用 API
- 创建数组
- 数组处理程序
- 二进制运算
- 字符串操作
- C-Types 外部函数接口(numpy.ctypeslib)
- 时间日期相关
- 数据类型相关
- 可选的 Scipy 加速支持(numpy.dual)
- 具有自动域的数学函数( numpy.emath)
- 浮点错误处理
- 离散傅立叶变换(numpy.fft)
- 财金相关
- 实用的功能
- 特殊的 NumPy 帮助功能
- 索引相关
- 输入和输出
- 线性代数(numpy.linalg)
- 逻辑函数
- 操作掩码数组
- 数学函数(Mathematical functions)
- 矩阵库 (numpy.matlib)
- 杂项(Miscellaneous routines)
- 填充数组(Padding Arrays)
- 多项式(Polynomials)
- 随机抽样 (numpy.random)
- 操作集合(Set routines)
- 排序,搜索和计数(Sorting, searching, and counting)
- Statistics
- Test Support (numpy.testing)
- Window functions
- 打包(numpy.distutils)
- NumPy Distutils 用户指南
- NumPy C-API
- NumPy 的内部
- NumPy 和 SWIG
其他文档
文章来源于网络收集而来,版权归原创者所有,如有侵权请及时联系!
Test Support (numpy.testing)
Common test support for all numpy test scripts.
This single module should provide all the common functionality for numpy tests in a single location, so that test scriptsopen in new window can just import it and work right away. For background, see the Testing Guidelines
Asserts
method | description |
---|---|
assert_almost_equalopen in new window(actual, desired[, …]) | Raises an AssertionError if two items are not equal up to desired precision. |
assert_approx_equalopen in new window(actual, desired[, …]) | Raises an AssertionError if two items are not equal up to significant digits. |
assert_array_almost_equalopen in new window(x, y[, decimal, …]) | Raises an AssertionError if two objects are not equal up to desired precision. |
assert_allcloseopen in new window(actual, desired[, rtol, …]) | Raises an AssertionError if two objects are not equal up to desired tolerance. |
assert_array_almost_equal_nulpopen in new window(x, y[, nulp]) | Compare two arrays relatively to their spacing. |
assert_array_max_ulpopen in new window(a, b[, maxulp, dtype]) | Check that all items of arrays differ in at most N Units in the Last Place. |
assert_array_equalopen in new window(x, y[, err_msg, verbose]) | Raises an AssertionError if two array_like objects are not equal. |
assert_array_lessopen in new window(x, y[, err_msg, verbose]) | Raises an AssertionError if two array_like objects are not ordered by less than. |
assert_equalopen in new window(actual, desired[, err_msg, verbose]) | Raises an AssertionError if two objects are not equal. |
assert_raisesopen in new window(exception_class, callable, …) | Fail unless an exception of class exception_class is thrown by callable when invoked with arguments args and keyword arguments kwargs. |
assert_raises_regexopen in new window(exception_class, …) | Fail unless an exception of class exception_class and with message that matches expected_regexp is thrown by callable when invoked with arguments args and keyword arguments kwargs. |
assert_warnsopen in new window(warning_class, *args, **kwargs) | Fail unless the given callable throws the specified warning. |
assert_string_equalopen in new window(actual, desired) | Test if two strings are equal. |
Decorators
method | description |
---|---|
decorators.deprecatedopen in new window([conditional]) | Filter deprecation warnings while running the test suite. |
decorators.knownfailureifopen in new window(fail_condition[, msg]) | Make function raise KnownFailureException exception if given condition is true. |
decorators.setastestopen in new window([tf]) | Signals to nose that this function is or is not a test. |
decorators.skipifopen in new window(skip_condition[, msg]) | Make function raise SkipTest exception if a given condition is true. |
decorators.slowopen in new window(t) | Label a test as ‘slow’. |
decorate_methodsopen in new window(cls, decorator[, testmatch]) | Apply a decorator to all methods in a class matching a regular expression. |
Test Running
method | description |
---|---|
Testeropen in new window | alias of numpy.testing._private.nosetester.NoseTester |
run_module_suiteopen in new window([file_to_run, argv]) | Run a test module. |
rundocsopen in new window([filename, raise_on_error]) | Run doctests found in the given file. |
suppress_warningsopen in new window([forwarding_rule]) | Context manager and decorator doing much the same as warnings.catch_warnings. |
Guidelines
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论