python-numpy
来源:互联网 发布:unity3d ios 红色问号 编辑:程序博客网 时间:2024/05/17 13:43
array增加1行或1列
np.row_stack((nx, row))
np.column_stack((nx, column))
>>> import numpy as np
>>> nx = np.array([[1,2,3],[4,5,6],[7,8,9]])>>> row = nx[-1]
>>> column = nx[:,-1]
>>> nx1 = np.row_stack((nx, row))
>>> nx2 = np.column_stack((nx, column))
>>> nx
array([[1, 2, 3],
[4, 5, 6],
[7, 8, 9]])
>>> nx1
array([[1, 2, 3],
[4, 5, 6],
[7, 8, 9],
[7, 8, 9]])
>>> nx2
array([[1, 2, 3, 3],
[4, 5, 6, 6],
[7, 8, 9, 9]])
>>>
阅读全文
0 0
- Python Numpy
- [python]numpy
- python numpy
- Python Numpy
- python numpy
- python ---numpy
- Python---Numpy
- Python--numpy
- Python Numpy
- python numpy
- python numpy
- Python numpy
- Python-numpy
- python-numpy
- python numpy
- python-numpy
- python numpy
- Python-NumPy
- Caffe编译和图像训练测试
- NYOJ 求次数(纪念第一百道题)
- POJ 3844 Divisible Subsequences
- HDU 6069 Counting Divisors
- LintCode之反转整数
- python-numpy
- 大数据人才稀缺 入行恰逢其时
- 欢迎使用CSDN-markdown编辑器
- linux下装apache踩过的坑
- 网站制作图表插件库汇总
- 并发queue的简单介绍(一)
- Android字符串判空处理
- 关于mongodb ,redis,memcache之间见不乱理还乱的关系和作用
- Secure Multi-party Computation