码迷,mamicode.com
首页 >  
搜索关键字:def    ( 28626个结果
JS—typeof、基本数据类型、数学函数——第三天
一、typeof 检测出来的数据类型 --> 基本数据类型 string number boolean null undefined --> 变量初始化了,但是没有赋值 --> 函数没有传实参,那么形参是undefined --> 函数没有返回值,那么函数调用完的地方是undefined --> 复 ...
分类:Web程序   时间:2021-04-28 12:17:27    阅读次数:0
好不容易写完的词云
from PIL import Image import wordcloud import numpy as np import matplotlib.pyplot as plt import jieba #文本处理 def f(): with open('停用词.txt','r',encoding ...
分类:其他好文   时间:2021-04-28 12:10:50    阅读次数:0
李尔王皮卡丘
from PIL import Image import wordcloud import numpy as np import matplotlib.pyplot as plt import jieba #文本处理 def f(): with open('停用词.txt','r',encoding ...
分类:其他好文   时间:2021-04-28 12:10:30    阅读次数:0
字符串反转的几种方法
def reverse_str(s): from functools import reduce res = s[::-1] # 切片 res = "".join(list(reversed(s))) # 反转函数 res = reduce(lambda x,y:y+x, s) # reduce p ...
分类:其他好文   时间:2021-04-28 12:06:36    阅读次数:0
centos8编译安装php8
2021年4月24日17:29:22 环境: php8.0.3 centos 8.3 ./configure \ --prefix=/usr/local/php8 \ --with-config-file-path=/usr/local/php8/etc \ --with-curl \ --with ...
分类:Web程序   时间:2021-04-27 15:21:59    阅读次数:0
#工作小妙招#如何批量创建文件夹
方法一:cmd脚本 md 文件名+空格+文件名+空格+文件名 如md 1 2 3 保存为bat 如下图 方法二:python 脚本 如上为单个文件创建成功,既然用到python,肯定是想创建多个,新增如下代码 具体代码如下 import re def mkdir(path): # 引入模块 impo ...
分类:其他好文   时间:2021-04-27 15:10:37    阅读次数:0
typescript 数组类型的定义
简单的定义 const numArr:number[]=[1,2,3] const strArr:string[]=['a','b','c'] const undeArr:undefined[]=[undefined,undefined] 数组中有字符串又有数组的类型 const arr:(numb ...
分类:编程语言   时间:2021-04-27 14:24:27    阅读次数:0
PyTorch——(6)2D函数优化实例
最小值点有4个 import numpy as np from mpl_toolkits.mplot3d import Axes3D from matplotlib import pyplot as plt import torch def himmelblau(x): return (x[0] * ...
分类:其他好文   时间:2021-04-27 14:12:10    阅读次数:0
求解两数之和Python
问题: 输入整型数组,返回两元素的索引,使得这两个元素之和为特定的结果。假设这两个元素为不同元素。例如: nums = [1,3,2,7] , target = 5返回[1,2], 因为nums[1] + nums[2] = 3 + 2 = 5; 当没有符合元素时, 返回null def two_s ...
分类:编程语言   时间:2021-04-26 13:31:02    阅读次数:0
求解平方根-牛顿迭代法
思路: def new_ton(num): if num == 0: return 0 res = int(sqrt(num, num)) print(res) def sqrt(n, x): cur = (n + x/n) / 2 if cur == n: return cur else: ret ...
分类:其他好文   时间:2021-04-26 13:26:36    阅读次数:0
28626条   上一页 1 ... 26 27 28 29 30 ... 2863 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!