1 Star 0 Fork 0

朱康宝 / CSDN

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
axis.py 218 Bytes
一键复制 编辑 原始数据 按行查看 历史
朱康宝 提交于 2018-12-26 10:25 . axis
import numpy as np
def foo(a):
return a.sum(), a.mean(), a.max()
a = np.arange(1, 10).reshape(3, 3)
print(a)
b = np.apply_along_axis(foo, 0, a)
print(b)
c = np.apply_along_axis(foo, 1, a)
print(c)
Python
1
https://gitee.com/kanadeblisst/CSDN.git
git@gitee.com:kanadeblisst/CSDN.git
kanadeblisst
CSDN
CSDN
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891