%matplotlibinlinefromsklearnimportdatasetsfrommatplotlibimportpyplotasplt#获取数据集digits=datasets.load_digits()#可视化foriinrange(1,11):plt.subplot(2,5,i)#划分成2行5列plt.imshow(digits.data[i-1].reshape([8,8]),c
分类:
其他好文 时间:
2018-10-08 17:15:33
阅读次数:
323
字符串也是一个模块,有自己的方法,可以通过模块导入的方式来调用 1,string模块导入 import string 2, 其用法 string.ascii_lowercase string.digits 更多更能可以用dir()函数查看其方法 文章来自 www.96net.com.cn ...
分类:
编程语言 时间:
2018-10-06 23:13:03
阅读次数:
342
列表是什么? 列表由一系列按特定顺序排列的元素组成。你可以创建包含字母表中所有字母、数字0-9或所有家庭成员姓名的列表;也可以将任何东西加入列表中,其中的元素之间可以没有任何关系。鉴于列表通常包含多个元素,给列表指定一个表示复数的名称(如letters、digits或names)是个不错的主意。 在 ...
分类:
编程语言 时间:
2018-10-06 17:09:12
阅读次数:
201
Codeforces 1060 b You are given a positive integer nn. Let S(x)S(x) be sum of digits in base 10 representation of xx, for example, S(123)=1+2+3=6S(123 ...
分类:
其他好文 时间:
2018-10-06 11:52:23
阅读次数:
172
Calculate a+b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (unless there are less tha ...
分类:
其他好文 时间:
2018-10-06 00:04:54
阅读次数:
166
Given a non-empty array of digits representing a non-negative integer, plus one to the integer. The digits are stored such that the most significant d ...
分类:
编程语言 时间:
2018-10-05 17:19:58
阅读次数:
157
Given a non negative integer num, repeatedly add all its digits until the result has only one digit. Example: Input: 38 Output: 2 Explanation: The pro ...
分类:
其他好文 时间:
2018-10-05 13:55:26
阅读次数:
163
贪心,找到最大的小于n的999999,就是n1,然后n2=n-n1 这两个就是最佳分配。 原因: 从99...99+x=n出发,如果99..9减去某个数,比如342,那么s(99..9)会减少s(342)=9,但是s(x+342)最多比s(x)多s(342),在没有进位发生的时候的确多了s(342) ...
分类:
其他好文 时间:
2018-10-05 10:49:54
阅读次数:
139
Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. A mapping of digit to le ...
分类:
其他好文 时间:
2018-10-04 10:00:48
阅读次数:
133
Atcoder刷不动的每日一题... 首先注意到一个事实:随着 \(l, r\) 的增大,\(f(r) - f(l)\) 会越来越小。考虑暴力处理出小数据的情况,我们可以发现对于左端点 \(f(l) <= 7\) 的情况下,右端点的最大限度为 \(\frac{10^8}{8} + 10^7\) 。这 ...