一 前言 本篇主讲内容为python基础模块random库的基本使用,读者熟悉基本用法即可,需要特殊要求查询官方文档即可 公众号: 知识追寻者 知识追寻者(Inheriting the spirit of open source, Spreading technology knowledge;) 二 ...
分类:
编程语言 时间:
2020-05-07 15:18:36
阅读次数:
67
将ArrayList中的元素按照给定字符拼接起来 public static void main(String[] args) { List<String> list = Arrays.asList("nice","to","meet","you"); System.out.println(list ...
分类:
编程语言 时间:
2020-05-07 00:34:55
阅读次数:
81
#!/bin/bashecho "1.剪刀 2.石头 3.布"game=(剪刀 石头 布)num=$[RANDOM%3]sui=${game[$num]}echo $suiecho $numwhile truedo read -ep "是否开始游戏,请输入yes或no" aa if [ aa == ...
分类:
其他好文 时间:
2020-05-06 21:57:00
阅读次数:
56
#!/bin/bashsui=$(expr $RANDOM % 100)ci=0echo "商品的价格"while truedo read -ep "请输入你猜测的价格" cai let ci++ if [ $cai -eq $sui ] then echo "恭喜你猜对了实际价格$sui" ech ...
分类:
其他好文 时间:
2020-05-06 21:45:48
阅读次数:
83
枚举一些随机图片的接口 http://lorempixel.com/1600/900 https://unsplash.it/1600/900?random 环境背景: https://img.xjh.me/random_img.php?type=bg&ctype=nature&return=302 ...
分类:
其他好文 时间:
2020-05-06 21:44:37
阅读次数:
85
from random import random def printIntro(): print("这个程序模拟两个选手A和B的某种竞技比赛") print("程序运行需要A和B的能力值(以0到1之间的小数表示)") def getInputs(): a = eval(input("请输入选手A的 ...
分类:
其他好文 时间:
2020-05-06 21:25:35
阅读次数:
52
# 直接生成时间索引,支持str, datetime.datetime rng=pd.DatetimeIndex(['12/1/2017','12/2/2017','12/3/2017','12/4/2017','12/5/2017']) print(rng,type(rng)) print(rng ...
分类:
其他好文 时间:
2020-05-06 01:28:02
阅读次数:
92
1 import requests 2 import time 3 import random 4 url = ['http://cq.srx123.com/', 5 'http://cq.srx123.com/article.php', 6 'http://cq.srx123.com/yszc.p ...
分类:
编程语言 时间:
2020-05-05 20:31:42
阅读次数:
67
随机森林(RandomForest) 简介: 在机器学习中,随机森林是一个包含多个决策树的分类器, 并且其输出的类别是由个别树输出的类别的众数而定。 Leo Breiman和Adele Cutler发展出推论出随机森林的算法。 而 “Random Forests” 是他们的商标。 这个术语是1995 ...
分类:
其他好文 时间:
2020-05-05 20:23:35
阅读次数:
489
一、函数中如果return是多个参数,只用一个参数接收时,是元组;也可以用多个参数接收,那就是解包 def func(): a = 1 b = 2 c = 3 return a,b,c q,w,e = func() print(func(),type(func()),q,w,e) 输出: (1, 2 ...
分类:
编程语言 时间:
2020-05-05 00:48:43
阅读次数:
82