import numpy as np import pylab as pl from sklearn import svm # we create 40 separable points #np.random.seed(0) X = np.r_[np.random.randn(100, 2) - [... ...
分类:
其他好文 时间:
2018-01-07 14:03:35
阅读次数:
292
1 # coding=utf-8 2 3 from scipy import optimize 4 import numpy as np 5 6 7 8 9 10 11 12 13 14 15 def get(args): 16 a, b, c, d, e, f, g, h = args 17 fu... ...
分类:
其他好文 时间:
2018-01-03 17:30:05
阅读次数:
4151
import numpy as np import pandas as pd import scipy import matplotlib.pyplot as plt '''数据导入''' df = pd.read_csv(r'C:\Users\Administrator\Desktop\app01... ...
分类:
其他好文 时间:
2017-12-31 21:14:02
阅读次数:
201
第一步:安装插件 pip install Numpypip install matploatlib 第二步 导入包 import numpy as np import matplotlib.pylot as plt x=np.arange(0,2*np.pi,0.01) y=np.sin(x) pl ...
分类:
编程语言 时间:
2017-12-30 18:09:10
阅读次数:
116
1 >>> a = np.array([[1, 2], [3, 4]]) 2 >>> np.std(a) # 计算全局标准差 3 1.1180339887498949 4 >>> np.std(a, axis=0) # axis=0计算每一列的标准差 5 array([ 1., 1.]) 6 >>>... ...
分类:
编程语言 时间:
2017-12-28 16:09:03
阅读次数:
277
证明碰撞集问题(Hitting Set)是NP complete Problem In the HITTING SET problem, we are given a family of sets and a budget b, and we wish to find a set H of whic ...
分类:
其他好文 时间:
2017-12-28 16:08:25
阅读次数:
194
import collections import numpy as np import random import time def list_to_dict(lst): dic = {} for i in lst: dic[i] = lst.count(i) return dic def col... ...
分类:
编程语言 时间:
2017-12-28 12:03:30
阅读次数:
234
Pandas 数据结构 first: import numpy as np import pandas as pd Series 1.支持任意类型的一维标签数据,分为数据部分和轴标签部分(索引) 2.可以从list,dict,ndarray,scalar value等数据类型来创建 3.Series ...
分类:
其他好文 时间:
2017-12-27 18:49:34
阅读次数:
215
1.range()返回的是range object,而np.arange()返回的是numpy.ndarray() range尽可用于迭代,而np.arange作用远不止于此,它是一个序列,可被当做向量使用。 2.range()不支持步长为小数,np.arange()支持步长为小数 3.两者都可用于 ...
分类:
编程语言 时间:
2017-12-27 18:00:07
阅读次数:
152
np.newaxis 在使用和功能上等价于 None,其实就是 None 的一个别名。 1. np.newaxis 的实用 2. 索引多维数组的某一列时返回的是一个行向量 如果我索引多维数组的某一列时,返回的仍然是列的结构,一种正确的索引方式是: 如果想实现第二列和第四列的拼接(层叠): 当然更为简 ...
分类:
其他好文 时间:
2017-12-25 19:36:59
阅读次数:
207