自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(16)
  • 收藏
  • 关注

原创 机器学习、深度学习资源

强化学习:RL baselinesminimalRL机器学习和数据科学Machine-Learning-and-Data-Science

2019-05-27 14:16:24 116

原创 一个5位数是其5个数字之和的2007倍,求这个5位数。

题目:一个5位数是其5个数字之和的2007倍,求这个5位数。解答:def sum_of_item(data): data_str=str(data) a=sum([int(x) for x in data_str]) return afor item in range(10000,1000000): if item==2007*sum_of_item(ite...

2019-05-23 10:03:19 675

原创 jupyter notebook远程连接服务器及安装扩展时遇到的坑

文章目录1.jupyter notebook远程连接服务器1.1 生成一个 notebook 配置文件1.2 生成密码自动生成手动生成(本人采用的方法)1.3 修改配置文件2. 添加jupyter-notebook的扩展原链接: jupyter notebook远程连接服务器设置 jupyter notebook 可远程访问的官方指南在这里,在远端服务器上执行以下操作:1.jupyter n...

2019-05-22 20:20:40 1101

原创 python实现 123456789给出一个排列来,使得前n位组成的整数能被n整除(n=1,2,3,...,9)

123456789给出一个排列来,使得前n位组成的整数能被n整除(n=1,2,3,…,9)。下面给的是一种比较直观的解法1.因为前n位组成的整数能被n整除,所以当要求前5位组成的数被5整除时,第5位只能是52.要求前2、4、6、8位组成的数能被2、4、6、8整除,那么第2、4、6、8位只能是偶数,所以1、3、5、7、9只能是奇数,所以最后的9位数应该是长这样, 括号中的数代表只取其中一个值...

2019-05-22 11:05:44 2032

原创 一文弄懂pytorch中的pack和pad

链接:packing-unpacking-pytorch-minimal-tutorialsorry,翻译有空再补

2019-05-21 21:11:09 1269 1

原创 python学习资源

Problem Solving with Algorithms and Data Structures using PythonProblem Solving with Algorithms and Data Structures using Python 20190630消失Python:使用lambda应对各种复杂情况的排序,包括list嵌套dict...

2019-05-20 20:58:32 134

原创 python不定长参数 *args 的用法

gt.csv301 234 ['ad','bd','cd']301 235 ['a','b','c']301 237 ['af','bf','cf']301 239 ['a2','b2','c2']302 236 ['a1','b1','c1']303 238 ['a3','b3','c3']303 2323 ...

2019-05-16 21:43:30 1666

原创 python的神奇特性——更新中

文章目录metaclass判断变量是否为整数学习资源metaclassWhat are metaclasses in Python?举个例子:type可以用于创建类,和直接创建类的操作是一样的>>> class Foo(): bar=True>>> Foo.barTrue>>> f=Foo()>>...

2019-05-15 20:31:16 171

原创 英语断句

###spacyimport spacynlp = spacy.load('en')sentences = nlp(u"That view is widespread in the custodial industry which has reacted with some alarm to the suggestion in the SIB paper.Instead, Mr White...

2019-05-09 21:47:02 785

原创 python NIMFA 非负矩阵分解

>>> import numpy as np>>> import scipy.sparse as spr>>> import nimfa>>> V=spr.csr_matrix([[1, 0, 2, 4], [0, 0, 6, 3], [4, 0, 5, 6]])>>> print(V) (0, ...

2019-05-08 10:36:32 1635

原创 汉诺塔问题

# 汉诺塔问题def move(src, dest): # 将一个盘子从一个针上移到另一个针上 print(src, "-->", dest)def hanoi(n, src, medium, dest): # 将多个盘子从一个针上移到另一个针上,是一个递归过程 if n == 1: move(src, dest) else:...

2019-05-04 17:50:55 142

原创 python实现sin函数

from math import fabsfrom math import pidef sin(x): g = 0 t = x n = 1 while (fabs(t) >= 1e-10): g += t n += 1 t = -t * x * x / (2 * n - 1) / (2 * n - 2) ...

2019-05-04 17:14:34 15022

原创 判断回文数--python

回文数是指其各位数字左右对称的整数。例如1221,676等。分析:判断一个数是否是回文数,可以用除以10取余的方法,从最低位开始,依次取出该数的各位数字,然后用最低位充当最高位,按反序重新构成新的数,与原数比较是否相等。若相等,则为回文数。def symm(n): i = n m = 0 while i > 0: m = m * 10 + i %...

2019-05-04 16:41:48 2044

原创 scipy.stats.norm函数

在这里插入代码片scipy.stats.norm函数 可以实现正态分布(也就是高斯分布)pdf : 概率密度函数标准形式是:norm.pdf(x, loc, scale)等同于norm.pdf(y) / scale ,其中 y = (x - loc) / scale调用方式用两种,见代码import numpy as npfrom scipy.stats import nor...

2019-05-03 23:14:29 31181

原创 itertools 中的排列组合

参考:https://docs.python.org/2/library/itertools.html#itertools.combinations_with_replacement

2019-05-01 19:15:00 354

原创 一行至三行命令能做的事(持续更新中)

找到在 Hamlet.txt 中出现最多的10个词>>> import re>>> words = re.findall(r'\w+', open('hamlet.txt').read().lower())>>> Counter(words).most_common(10)[('the', 1143), ('and', 966), ('...

2019-05-01 18:35:54 290

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除