当前位置:网站首页>[untitled] numpy learning
[untitled] numpy learning
2022-07-03 10:38:00 【weixin_ forty-three million six hundred and ninety-one thousand】
- Slicing and indexing ( Select rows and columns )t[2] t[3:,:] From the position 3 All lines are selected , Select column t[:,4:] A series of lines : t[2:,3] Discontinuous lines t[[1,3],[2,4]] The choice is (1,2)(3,4) Two positions Indexes t[2,3]
- assignment t[2:,3]=3
- Boolean index t[t>10]=10
- Ternary operator np.where(t>10,20,0) The greater than 10 The replacement of is 20 Replace others with 0
- tailoring t.clip(10,20) The less than 10 The replacement of is 10, about 20 The replacement of is 20
- Transposition t.transform() t.T t.swapaxes(1,0)
- Read local file np.loadtxt(file_file_path ,delimiter,dtype)
- nan and inf inf Express infinite nan It's not a number np.nan!=np.nan np.count_nonzero(na.nan!=np.nan) np.isan(t1) Effects np.nan!=np.nan identical
- Common statistical functions t.sum(axis=0) np.median(t,axis=0) t.mean(axis=0) t.max() t.mean() np.mean() np.ptp The calculation is very poor t.std Standard deviation Reaction data dispersion
Add country information Splice two sets of data
np.loadtxt(us_data,delimiter=",",dytepe=int)
Construct all zero data ,zeros_data=np.zeros()
ones_data=np.data()
Add data
us-data=np.hstack()
Create an array of all zeros , All in one number
np,eyes(5)
Get the maximum , minimum value
np.argmax(t,axis=0)
np.argmin(t,axis=0)
np.random.randint() Given the upper and lower limits, select the random number certificate
.rand()
.randn()
.unifi
np.random.seed()
t=np.random.randint()
边栏推荐
猜你喜欢

Neural Network Fundamentals (1)

Hands on deep learning pytorch version exercise solution-3.3 simple implementation of linear regression

侯捷——STL源码剖析 笔记

Ut2016 learning notes

Are there any other high imitation projects

Matrix calculation of Neural Network Introduction (pytoch)

2018 y7000 upgrade hard disk + migrate and upgrade black apple

Model evaluation and selection

六、MySQL之数据定义语言(一)

Judging the connectivity of undirected graphs by the method of similar Union and set search
随机推荐
Julia1.0
Leetcode刷题---10
Leetcode刷题---374
Hands on deep learning pytorch version exercise solution - 2.4 calculus
Leetcode刷题---44
Leetcode刷题---977
Softmax 回归(PyTorch)
神经网络入门之预备知识(PyTorch)
QT creator uses OpenCV Pro add
Raspberry pie 4B installs yolov5 to achieve real-time target detection
神经网络入门之矩阵计算(Pytorch)
Leetcode刷题---832
二分查找法
Unity小组工程实践项目《最强外卖员》策划案&纠错文档
Secure in mysql8.0 under Windows_ file_ Priv is null solution
SQL Server Management Studio cannot be opened
Ind kwf first week
Leetcode skimming ---10
mysql5.7安装和配置教程(图文超详细版)
深度学习入门之线性回归(PyTorch)