代码: # -- coding: gbk -- from sklearn.datasets import load_breast_cancer from pylab import * from sklearn.model_selection import train_test_split from ...
分类:
编程语言 时间:
2020-03-25 01:55:34
阅读次数:
131
问题描述 Java中,我们有时需要对现有的字符串进行切割并转化成一个List集合。 解决方案 Java.lang 包中的 String.split() 方法可对现有的字符串进行切割,并返回一个字符串数组 对 str 的遍历 所以我们可以用 Arrays.asList() 方法,将数组转化为 List ...
分类:
其他好文 时间:
2020-03-24 23:37:06
阅读次数:
174
const str="hello world"; const [a,b,...oth]=str; 字符串分割为数组的三种方法: const str="hello world"; const [...str1]=str; const str2=[...str]; const str3=str.spli ...
分类:
其他好文 时间:
2020-03-24 23:03:12
阅读次数:
94
一、 Github地址: https://github.com/huihuigo/wc 二、 解题思路 功能分析 wc.exe -c file.c //返回文件 file.c 的字符数 wc.exe -w file.c //返回文件 file.c 的词的数目 wc.exe -l file.c //返 ...
分类:
其他好文 时间:
2020-03-24 18:38:09
阅读次数:
79
原因:小数计算会转化为二进制 精度丢失 举个例子:4.02*10的N次方 怎么算都是错的; 常见问题 0.1+0.2 !=0.3 。。。 处理:转化为小数进行计算 //加法 function addNum (a,b){ var c,d,e; try { c = a.toString().split( ...
分类:
Web程序 时间:
2020-03-24 12:59:00
阅读次数:
79
最近在研究ThinkPHP5.1框架,服务器是CentOS7,在配置到Nginx的时候出了点小问题,因为测试练习的服务器上还有其他的程序,所以路径访问过程中需要重新配置。 1.tp5.1框架URL访问pathinfo模式,在访问中省略 index.php location / { if (!-e $ ...
分类:
Web程序 时间:
2020-03-24 10:38:49
阅读次数:
122
[toc] 属性 |代码|功能 | 备注| | | | | | | 字符串长度| | | 类型名称 | 如果是字符串会输出 | | | 取字符串第1,2,以及最后一位字符 | | 判断制定字符在字符串中的位置 | | 指定的字符(串)在s中出现了几次 | | 指定字符(串)在s中首次出现的位置(默认 ...
分类:
编程语言 时间:
2020-03-24 01:09:19
阅读次数:
100
因为注释已经很详细了,所以直接上代码: 1 from sklearn.datasets import load_iris 2 from sklearn.model_selection import train_test_split 3 #k临近算法 4 from sklearn.neighbors ...
分类:
编程语言 时间:
2020-03-24 01:07:42
阅读次数:
91
Java/JavaScript/Python字符串常用方法 Java JavaScript Python 其他类型转为字符串 String.valueOf(3.14) Strin(3.14)/3.14.toString() str(3.14) 比较字符串是否相等 s1.equals(s2) s1 s ...
分类:
编程语言 时间:
2020-03-22 23:56:21
阅读次数:
119
R进行数据分析 1. 排序 sort(x, decreasing = ): 返回排序好的数据 order(x, decreasing = ): 返回排序好的数据的索引 例子: v = c(2, 9, 1, 45, -3, 19, -5, 6) sort(v) # returns ordered v ...
分类:
其他好文 时间:
2020-03-21 21:49:39
阅读次数:
60