atr.py

import numpy as np
a = np.arange(9)
print("a:",a)
print(a[0:3])
print(a[3:6])
print(a[6:9])
print("testj:" ,np.maximum(a[0:3], a[6:9],a[3:6]))
print(a[0:3])
print(a[3:6])
print(a[6:9]) -----------------------
输入结果:

a: [0 1 2 3 4 5 6 7 8]
[0 1 2]
[3 4 5]
[6 7 8]
testj: [6 7 8]
[0 1 2]
[6 7 8]
[6 7 8]

-------------------------------------

atr.py

import numpy as np
a = np.arange(9)
print("a:",a)
print(a[0:3])
print(a[3:6])
print(a[6:9])
print("testj:" ,np.maximum(a[0:3],a[3:6],a[6:9]))
print(a[0:3])
print(a[3:6])
print(a[6:9])
-----------------------
输入结果:

a: [0 1 2 3 4 5 6 7 8]
[0 1 2]
[3 4 5]
[6 7 8]
testj: [3 4 5]
[0 1 2]
[3 4 5]
[3 4 5]

最后print(“a:”a)
结果a: [0 1 2 3 4 5 3 4 5]

最新文章

  1. Python中利用LSTM模型进行时间序列预测分析
  2. [MySql]explain用法及实践
  3. C++ Primer :第十章 :泛型算法之再探迭代器以及其他算法
  4. Python中用datetime包进行对时间的一些操作
  5. Cgroups概述
  6. GCC编译器入门
  7. Java基础知识强化70:正则表达式之引入案例(QQ号码校验)
  8. CentOS 7安装SVN以及高版本SVN
  9. Linux下配置APACHE支持PHP环境
  10. cocos creator主程入门教程(八)—— 代码结构
  11. php常用数组array函数实例总结【赋值,拆分,合并,计算,添加,删除,查询,判断,排序】
  12. 找出数组中最大值and索引
  13. "Linux内核分析"第六周实验报告
  14. How to set the bash display to not show the vim text after exit?
  15. 运行程序,解读this指向---case4
  16. DP练习 巡逻
  17. php excel 读取日期问题
  18. Oracle rman 脚本
  19. swift算法手记-10
  20. ogre3D学习基础2 -- 顶点程序与片断程序

热门文章

  1. Android短信过滤项目中的观察者模式
  2. SpringCloud系列十:SpringCloudConfig 高级配置(密钥加密处理(JCE)、KeyStore 加密处理、SpringCloudConfig 高可用机制、SpringCloudBus 服务总线)
  3. c#_生成图片式验证码
  4. C# Func与Action
  5. 3.搭建Samba服务器
  6. fsync和fdatasync
  7. JS高级总结
  8. tarjan求强连通分量
  9. 深入理解C++11【4】
  10. python之全局变量与局部变量