logo
publist
写文章

简介

该用户还未填写简介

擅长的技术栈

可提供的服务

暂无可提供的服务

numpy生成等差等比数列

文章目录arangelinspacelogspacearangeimport numpy as npa=np.arange(1,10,2)结果aOut[3]: array([1, 3, 5, 7, 9])linspacenumpy.linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=None, axis=0)参数意义s

#python#矩阵#机器学习
MATLAB绘制动画/动图-VideoWriter

在MATLAB中,有时候需要把多张图绘制一个动图,以表示,那么如何绘制呢?http://www.voidcn.com/article/p-wfxerpjf-bmk.html先创建一个文件,扩展名avi,这里以 videos.aviset(gca,‘nextplot’,‘replacechildren’);video_w= VideoWriter(‘videos.avi’);videos_w.Fra

#matlab
强化学习论文中的算法框图

摘自 Ding, R., Xu, Y., Gao, F., & Shen, X.(. (2022). Trajectory Design and Access Control for Air–Ground Coordinated Communications System With Multiagent Deep Reinforcement Learning. IEEE Internet of T

#机器学习
改变ndarray的dtype, type: ndarray.view

ndarray.view([dtype][, type])官方文档不改变数据域,设置dtype和type,返回更改后的数组dtype: data-type or ndarray sub-class, optional数据的类型, e.g., float32 or int16. 如果被传参数则保持不变type:Python type, optional数组的type属性, e.g., ndarray

#python
numpy中元素的重复numpy.repeat

numpy.repeat(a, repeats, axis=None)[source]官方文档a:输入矩阵repeats:元素重复的次数axis:在哪个axis上重复,如把每一行重复若干次就置axis=0,把每一列重复若干次就置axis=1示例>>> np.repeat(3, 4)array([3, 3, 3, 3])>>> x = np.array([[1,2

#人工智能#机器学习#python
Numpy 中的 mask

定义 若a是一个numpy数组,和它shape相同bool型的numpy数组称为a的一个maska[mask]输出的是一个一维数组,它是由满足如下的元素构成mask为True的位置在a中对应的元素举个例子import numpy as npa=np.array([[1,2],[3,4]])mask=a>1print(a[mask])结果为: array([2, 3, 4])...

numpy阶跃函数 numpy.heaviside

numpy.heaviside(x1,x2)Compute the Heaviside step function.官方链接x1 [array_like] Input values.x2 [array_like] The value of the function when x1 is 0.示例:np.heaviside([-1.5, 0, 2.0], 0.5)array([ 0. ,0.5,1.

#python#numpy#人工智能 +1
numpy.real 和 numpy.image

示例:import numpy as npmat= np.array([1+2j, 3+4j, 5+6j])print('mat=',mat)print('实部:',np.real(mat))print('虚部:',np.imag(mat))结果:mat= [1.+2.j 3.+4.j 5.+6.j]实部: [1. 3. 5.]虚部: [2. 4. 6.]相当于mat.realmat.imag..

#python#numpy#人工智能 +1
    共 35 条
  • 1
  • 2
  • 3
  • 4
  • 请选择