np.random的随机数函数(1) | 函数 | 说明 | | : : | : : | | rand(d0,d1,..,dn) | 根据d0‐dn创建随机数数组,浮点数, [0,1),均匀分布 | | randn(d0,d1,..,dn) | 根据d0‐dn创建随机数数组,标准正态分布 | | r ...
分类:
其他好文 时间:
2018-04-22 13:02:14
阅读次数:
218
```python
import numpy as np
import matplotlib.pyplot as plt
#用最小距离法(minimum distance algorithm)去检测目标点属于哪一个set #the distance of point x and point y
de... ...
分类:
编程语言 时间:
2018-04-22 10:53:36
阅读次数:
180
什么是P问题、NP问题和NPC问题 转载自http://www.matrix67.com/blog/archives/105 这或许是众多OIer最大的误区之一。 你会经常看到网上出现“这怎么做,这不是NP问题吗”、“这个只有搜了,这已经被证明是NP问题了”之类的话。你要知道,大多数人此时所说的NP ...
分类:
其他好文 时间:
2018-04-21 19:32:42
阅读次数:
135
1、导入numpy模块 import numpy as np 2、查看numpy版本信息 print(np.__version__) numpy的主要对象的多维数组Ndarray。Numpy中维度(dimensions)叫做轴(axis),轴的个数叫做秩。 3、通过列表创建一位数组 np.array ...
分类:
其他好文 时间:
2018-04-21 13:29:18
阅读次数:
182
import matplotlib.pyplot as pltimport numpy as np y = df.loc[0:100, 4].valuesy = np.where(y == 'Iris-setosa',-1,1)X = df.iloc[0:100,[0,2]].valuesplt.s ...
分类:
其他好文 时间:
2018-04-20 14:42:17
阅读次数:
153
1 import语句 ? 1 2 3 4 5 import pandas as pd import numpy as np import matplotlib.pyplot as plt import datetime import re ? 1 2 3 4 5 import pandas as p ...
分类:
其他好文 时间:
2018-04-18 22:28:15
阅读次数:
233
Recitation 2 numpy operations array index x = np.arange(10) 2 x:[ 0 1 4 9 16 25 36 49 64 81] print(x[:: 1]) all reversed print(x[8:1: 1]) reversed sli ...
分类:
其他好文 时间:
2018-04-17 22:17:51
阅读次数:
531
# coding=gbk # 重点: 1. tkinter.Tk() 创建窗口 # tkinter.Toplevel(a) 创建窗口,在窗口a的顶端 # 2. 以字典的形式保存账户和密码 # exist_usr_info[nn] = np # usrs_info = {'admin': 'admin ...
分类:
其他好文 时间:
2018-04-16 20:35:13
阅读次数:
186
import numpy as np a1=np.arange(16).reshape(4,4) a2=np.arange(2,34,2).reshape(4,4) a1 Out[10]: array([[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11], [ ...
分类:
编程语言 时间:
2018-04-15 11:47:51
阅读次数:
226
1 import threading, time 2 import numpy as np 3 res = [] 4 class MyThread(threading.Thread): 5 def __init__(self,i,j,m1,m2): 6 threading.Thread.__init... ...
分类:
编程语言 时间:
2018-04-12 21:01:01
阅读次数:
511