当前位置:网站首页>[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()
边栏推荐
猜你喜欢

I really want to be a girl. The first step of programming is to wear women's clothes

Ut2015 learning notes

一个30岁的测试员无比挣扎的故事,连躺平都是奢望

深度学习入门之自动求导(Pytorch)

Data preprocessing - Data Mining 1

7、 Data definition language of MySQL (2)

Knowledge map enhancement recommendation based on joint non sampling learning

Jetson TX2 brush machine

Softmax regression (pytorch)

Knowledge map reasoning -- hybrid neural network and distributed representation reasoning
随机推荐
Jetson TX2 刷机
Leetcode刷题---1
conda9.0+py2.7+tensorflow1.8.0
An open source OA office automation system
Codeup: word replacement
Configure opencv in QT Creator
A super cool background permission management system
[LZY learning notes dive into deep learning] 3.4 3.6 3.7 softmax principle and Implementation
实战篇:Oracle 数据库标准版(SE)转换为企业版(EE)
The imitation of jd.com e-commerce project is coming
Ind FHL first week
A complete mall system
R language classification
[graduation season] the picture is rich, and frugality is easy; Never forget chaos and danger in peace.
深度学习入门之线性回归(PyTorch)
Realize an online examination system from zero
重写波士顿房价预测任务(使用飞桨paddlepaddle)
Leetcode skimming ---189
Adaptive Propagation Graph Convolutional Network
MySQL报错“Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggre”解决方法