Python基础 | 你想要的随机数生成都在这里!

Python 获取随机数 print('方法4:' + str(round(randnum, 2)))print('方法2:{:.2f}'.format(randnum))# 输出 1 <= number < 100 间的偶数。print(f'方法1:{randnum:.2f}')print('方法3:%.2f' % randnum)随机返回参数列表中任意两个元素,参数二指定返回的数量。start -- 指定范围内的开始值,包含在范围内。stop -- 指定范围内的结束值,不包含在范围内。随机返回参数列表中任意一个元素。 阅读详情

在利用Python在进行数据分析的时候,经常需要按照某种规则快速生成实数序列,尤其是在学习matplotlib绘图的时候,需要模拟生成数据,然后开始绘制。

那么在 Python 中有哪些方式生成实数序列呢?本文将为大家一一介绍,全面总结。

在numpy中有多种生成序列的函数,分别是arange、linspace、logspace和geomspace,那么这几种方式有哪些区别呢?我们在日常开发中如何选择合适的方法来生成需要的实数呢?

arange

Python资源共享群:484031800

numpy.arange([start, ]stop, [step, ]dtype=None)

start默认是0,step默认是1.

这个函数的用法非常简单,给定一个start, 一个stop, 一个步长,然后就可以得到你想要的数据。

注意:

生成的数据不包含stop的值。

案例1:直接给定stop,start和step采用默认值。

从0开始,按照步长为1,生成数据,到3结束,注意不含3.

In [32]:

np.arange(3)

Out[32]:

array([0, 1, 2])

案例2:指定start和stop,按照默认的step=1的方式来生成数据。

In [33]:

np.arange(1,3)

Out[33]:

array([1, 2])

案例3:指定start、stop和step的值。

start为1,stop为3,步长为0.1.

In [35]:

np.arange(1,3,0.1)

接下来我们将和大家一起来看看另外的三个***space的用法。

linspace

numpy.linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=None)

linspace的作用是生成等差数列。

num默认为50, endpoint默认为True, retstep默认是False即不返回步长大小

endpoint指的是生成的序列中是否包含stop这个数,True就是包含,False就是不包含。

案例1:1-50之间生成50个数。

此处并没有指定生成的实数序列的个数,采用的是默认值50个。

In [4]:

np.linspace(1,50)

 

 

 

 

 

 

案例2:1-50之间生成25个数

In [36]:

np.linspace(1,50,25)

 

 

 

 

 

 

案例3:1-50之间生成25个数,并打印步长信息。

In [37]:

np.linspace(1,50,retstep=True)

 

 

 

 

 

 

案例4:1-50之间生成25个数,不含50,且打印步长。

In [40]:

np.linspace(1,50, endpoint=False, retstep=True)

 

 

 

 

 

 

logspace

numpy.logspace(start, stop, num=50, endpoint=True, base=10.0, dtype=None)

logspace的作用是生成以底数为base,指数为start-stop的实数序列,其用法与linspace非常类似,其中base参数指定了底数。

案例1:生成1-50,底数为10的指数序列。

In [41]:

np.logspace(1,50)

 

 

 

 

 

 

案例2:生成1-50,底数为2的序列。

In [42]:

np.logspace(1,50,base=2)

 

 

 

 

 

 

案例3:1-50区间内生成5个数,底数为2的序列。

In [44]:

np.logspace(1,50,num=5,base=2)

geomspace

numpy.geomspace(start, stop, num=50, endpoint=True, dtype=None)

geomspace的作用是生成等比数列,指定start、stop和序列个数,即可生成等比数列。

案例1:1-50区间内,生成默认的50个数的等比数列。

In [49]:

np.geomspace(1,50)

 

 

 

 

 

 

案例2:1-16区间内,生成5个数的等比数列。

In [50]:

np.geomspace(1,16,num=5)

结语

本文为大家介绍了利用numpy生成实数序列的四种方法,分别是arange,linspace,logspace和geomspace。 今后在不同的应用场景下可以选择不同的方式来生成数据。

基于Python实现学习进度跟踪系统 {{ task }}: {{ "%.1f"|format(hours) }}小时 阅读详情

相关推荐

QComboBox设置最大显示数量多余的用滑动条,以及QComboBox::setMaxVisibleItems()不起作用的问题

QComoboBox是Qt封装的一个选择框的东西,但是我在使用过程中有一点感觉很不好,如图: 不论你往里面添加多少个它都会给你显示全部,甚至给你铺满全屏,后来看了官方文档发现有个setMaxVisibleItems()的方法,我欣喜若狂啊,终于特么的能解决了,但是,很遗憾,不知为啥,我设置上之后并没有起作用,依然会显示全部,后来搜了百度发现有个人是这样解决的 QComboBox *box = ne...

Aboveground的博客 4924

Numpy之random学习

Numpy random模块中常用函数的用法

每天进步一点点2017 4万+

随机数

生成50个不重复的随机数(1-50之间)srand((int)time(0)); 或 srand(50); //产生0到49之间的随机数 for(int i=0;i<50;i++) { int num=rand()%50+1; if(!vis[num]) { a[cnt++]=num; vis[num]=1; } els

1.3秒前 970

zemax混合式非序列模拟

注意不要点击左侧的非序列模式,那个时纯粹的非序列,会清除序列模式的数据。第2、4、6透镜材质为空气,是为了让光线进入到多重透镜内部。这时普通的优化方式会失败。平行光束经过多焦透镜时,会汇聚在不同焦距处。所以还需要控制能量的大小,进行优化。接下来用非序列模式设计一个多焦透镜。像面的孔径为圆形通光孔:0-1.2。透镜不同位置处有不同的聚焦位置。透镜的z轴位置相同,重合。

fendoudecheng的博客 3072

如何从Matlab工作区读取数据,并按时序将数据输入Simulink中

如何从Matlab工作区读取数据,并按时序将数据输入Simulink中 例如:一周掌握 Java 入门知识 学习内容: 提示:这里可以添加要学的内容 例如: 1、 搭建 Java 开发环境 2、 掌握 Java 基本语法 3、 掌握条件语句 4、 掌握循环语句 学习时间: 提示:这里可以添加计划学习的时间 例如: 1、 周一至周五晚上 7 点—晚上9点 2、 周六上午 9 点-上午 11 点 3、 周日下午 3 点-下午 6 点 学习产出: 提示:这里统计学习计划的总量 例如: 1、 技术笔记 2 遍

weixin_44899540的博客 1万+

python中生成随机数的方法

一、使用random模块(import random) 1.random.random():随机生成一个0~1之间的浮点数。 2.random.uniform(a,b):随机生成一个(a,b)之间的浮点数。 3.random.randint(a,b):随机生成一个(a,b)之间的整数。 4.random.randrange(a,b,n):随机生成(a,a+n,a+2n,...,b)之中的一个数。 5.random.choice(sequence):随机生成序列中的一个元素。 6.random.shuffle

RF~or的博客 909

一网打尽身份验证与授权:深入剖析ASP.NET Core Identity在C#中的全方位实战应用

ASP.NET Core Identity 是 Microsoft 提供的一个强大且可扩展的身份验证和授权框架,用于构建基于用户账户、角色和权限的Web应用程序。它提供了用户注册、登录、密码管理、多因素认证、角色分配、授权等功能,与ASP.NET Core框架深度集成,简化了安全相关的开发工作。通过上述代码示例和注释,展示了如何安装配置Identity、自定义用户实体与数据库上下文、实现用户注册登录、管理角色与用户角色关系,以及如何使用授权策略保护应用程序资源。,并指定用户和角色类型以及主键类型。

java专栏 1533

AcWing 1264. 动态求连续区间和 ,详细讲解线段树与树状数组(Python,篇一)

自己写了半天的博客发现还是水平有限,介绍的知识点不太全面,这里引用一篇其他博主的线段树介绍什么是线段树,介绍的内容很细也很好理解。这里说明一下问什么要开4n倍的数组空间:设最后有n个叶结点,对应的满二叉树最多有2n个叶结点(这是因为极端情况是倒数第二层区间长度1,2交替) 然后根据(2n)+n+n/2…<=4n下面结合具体题目来看看如何用线段树解决实际问题。

2301_77160836的博客 1270

vue3:html2canvas+jspdf将页面以A4导出为PDF文件,解决内容截断+在分页处截断问题详细排查和解决教程(jsPDF + html2canvas A4分页截断、内容分页时存在截断)

html2canvas + jsPDF 解决内容截断问题,vue3 jspdf-html2canvas生成多页pdf防截断处理(包含代码),vue3解决html2canvas + jsPDF导出pdf分页内容截断问题,jsPDF + html2canvas A4分页截断 完美解决方案(含代码 + 案例),html页面导出pdf截断问题,html2canvas 与 jspdf 相结合生成 pdf 内容被截断的终极解决方案,提供html2canvas+jsPDF将HTML页面以A4纸方式导出为PDF后,内容分页

✅ 精选推荐文章 2249

(一)激光线扫描-三维成像原理

激光线扫描是一种使用激光作为光源,通过特定的扫描设备(如光学镜头、电机驱动的镜头或电子扫描设备)将激光束引导到目标表面,并按照预定的路径进行扫描的技术。这种技术通常用于测量、检测、打印、切割等多种应用中。

FlyWine的博客 3641

Python Numpy random 生成随机数

生成随机数 ,NumPy提供了random模块来处理随机数。 1.生成一个从0到100的随机整数: from numpy import random x = random.randint(100) print(x) 2.生成随机浮点数(float) 随机模块的rand()方法返回0到1之间的随机浮点数。 例如: 生成从0到1的随机浮点数: from numpy import random x = random.rand() print(x) 3、生成随机数组 在NumPy中,使

yihanyifan的博客 1万+

YOLO26 vs YOLOv12 vs YOLOv10:工业场景性能实测,速度/精度/部署难度全对比(附完整测试代码)

YOLO26:工业场景全能型选手,无NMS+无DFL设计让部署和推理都省心,小目标精度优势明显,CPU推理速度提升43%,适合大多数生产线场景YOLOv12:中大型目标检测专家,Area Attention在复杂背景下表现出色,适合汽车、家电等大型零部件检测YOLOv10:速度狂魔,GPU上性能领先,轻量化版本适合边缘部署,但小目标精度略逊,适合对实时性要求极高的分拣线场景。

专注于Python爬虫开发,分享爬虫技巧、项目实战与反爬经验,使用Scrapy、BeautifulSoup等工具,解决数据抓取难题。 629

python随机生成数字的函数_Python基础 | 你想要的随机数生成都在这里!

在利用Python在进行数据分析的时候,经常需要按照某种规则快速生成实数序列,尤其是在学习matplotlib绘图的时候,需要模拟生成数据,然后开始绘制。那么在 Python 中有哪些方式生成实数序列呢?本文将为大家一一介绍,全面总结。在numpy中有多种生成序列的函数,分别是arange、linspace、logspace和geomspace,那么这几种方式有哪些区别呢?我们在日常开发中如何选择...

weixin_39892311的博客 358

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版

Part-E1-SDIO-Specification-Ver4.00-Final-120220.pdf:最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版,包括SDIO 接口的外设,SDIO 接口官方协议等。

python生成50个随机数_Python基础 | 你想要的随机数生成都在这里

欢迎点击「算法与编程之美」↑关注我们!本文首发于微信公众号:"算法与编程之美",欢迎关注,及时了解更多此系列文章。在利用Python在进行数据分析的时候,经常需要按照某种规则快速生成实数序列,尤其是在学习matplotlib绘图的时候,需要模拟生成数据,然后开始绘制。那么在Python中有哪些方式生成实数序列呢?本文将为大家一一介绍,全面总结。在numpy中有多种生成序列的函数,分别是arange...

weixin_39888807的博客 3417

pscad IEEE标准系统搭建说明

pscad IEEE标准系统搭建说明,包含典型的IEEE 9节点、14节点、30节点、39节点和118节点系统。内含标准测试系统的原始数据和潮流结果。

Python基础 | 你想要的随机数生成都在这里

欢迎点击「算法与编程之美」↑关注我们!本文首发于微信公众号:"算法与编程之美",欢迎关注,及时了解更多此系列文章。在利用Python在进行数据分析的时候,经常需要按照某种...

算法与编程之美 575

【Python 基础教程】Python生成随机数

记录了生成随机数的几种方式以及生成随机列表的几种方法。

一个非常Cool的人 2万+

Python中产生随机数

Python产生随机数: 一.Python自带的random库 1.参生n--m范围内的一个随机数: random.randint(n,m) 2.产生0到1之间的浮点数: random.random() 3.产生n---m之间的浮点数: random.uniform(1.1,5.4) 4.产生从n---m间隔为k的整数: ...

zq476668643的博客 26万+

python随机数(random)

需要导入的库: import random import string 一、随机整数: 1、包含上下限:[a, b] random.randint(a,b) 在python中的random.randint(a,b)用于生成一个指定范围内的整数。其中参数a是下限,参数b是上限,生成的随机数n: a <= n <= b。 下限必须小于等于上限,大于上限报错。 random.randint(1,50)#随机生成最小值为1,最大值为50的整数(可以等于上下限) random.randint(20,

x_9992的博客 12万+

【原创】python基础 --- 随机数、随机小数、随机数列等全解!

前言: 在此总结python中常见用于生成随机数、随机数组、随机小数、随机数列表等的各种方法,会持续更新!!! 目前使用的库函数为: random库 numpy库 … 文章目录一、random库生成随机*1.1生成随机整数1.2生成随机小数1.3随机选择1.4生成随机数列表二、numpy.random库 一、random库生成随机* random.random() random.uniform(a,b) random.randint(a,b) random.randrange(a,b,step) ra

weixin_44094898的博客 7230

Python中随机数的生成

在Python中可以用于随机数生成的有两种主要途径,一是random模块,另一个是numpy库中random函数。 OUTLINE random模块 numpy中的random函数 总结 random模块 random模块中将近有7个函数都是可以用来生成随机数的: ① random.random() 功能:随机生成一个 [0,1) 的浮点数 用法: import rando...

Emily 12万+

python基础 - 生成随机数组

一、random模块 python的random模块中有一些生成随机数字的方法,例如random.randint, random.random, random.uniform, random.randrange,这些函数大同小异,均是在返回指定范围内的一个整数或浮点数,下边简单解释一下这几个函数。 from random import random from random import randint from random import uniform from random import rand

Rnan_prince的博客 1万+

python生成10个随机数-Python中产生随机数

一.Python自带的random库1.参生n--m范围内的一个随机数: random.randint(n,m)2.产生0到1之间的浮点数: random.random()3.产生n---m之间的浮点数: random.uniform(1.1,5.4)4.产生从n---m间隔为k的整数: random.randrange(n,m,k)5.从序列中随机选取一个元素: random.cho...

weixin_39929918的博客 2万+

python中随机数的取法

经常会遇到取随机数,总结一下常见的取随机数方法:(持续更新) 一、取随机数所需的包 python中取随机数有两种来源: a. 一个是python自带的随机数包,可以满足基本取随机数的需求。 b. 是numpy包中带的随机数,可以满足高级的取随机数需求。 二、 取随机数的分类 随机数相关命令非常多,记忆起来很复杂。但是从我们的需求入手,取随机数可以从六个维度考虑: a. 输出数据类型:浮点,整数,元...

fisherinriver的博客 5771

python指定范围的随机数_python random随机数、numpy.random随机数

random随机数表numpy.random简单随机数表numpy.random随机数分布表一、随机数产生原理介绍:python产生的随机数是伪随机数,产生原理如下:1、随机数是由随机种子根据一定算法得到的数值。如果不改变随机种子,产生的随机数也不会改变。2、默认情况下,随机种子来自系统的时钟。3、随机种子的产生算法与系统有关。Windows和Linux系统中产生的随机种子不同。二、random随...

weixin_42503456的博客 3万+
上一篇: 3步搞懂Python数据分析关键点!
下一篇: 3 行 Python 代码 5 秒抠图的 AI 神器,根本无需 PS !
普通网友
博客等级 码龄7年 438粉丝 263原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址