10 2018 档案

摘要:import numpy as np x = np.random.randint(1, 100, [20, 1]) y = np.zeros(20) k = 3 # 选取数据空间中的K个对象作为初始中心,每个对象代表一个聚类中心; def initcenter(x, k): return x[0:k].reshape(k) def nearest(kc, i): ... 阅读全文
posted @ 2018-10-31 21:57 陈松林 阅读(177) 评论(0) 推荐(0)
摘要:4、取出花的特性和类别数据,查看数据类型 阅读全文
posted @ 2018-10-29 11:41 陈松林 阅读(249) 评论(0) 推荐(0)
摘要:import time print (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())) print (time.strftime("%a %b %d %H:%M:%S %Y", time.localtime())) a = "Sat Mar 28 22:24:24 2016" print (time.mktime(time.s... 阅读全文
posted @ 2018-10-22 11:38 陈松林 阅读(170) 评论(0) 推荐(0)
摘要:#用列表+循环实现,并包装成函数 def Godo(n): a = list(range(n)) b = list(range(0,10*n,10)) c = [] for i in range(len(a)): c.append(a[i]**2+b[i]**3) return (c) print( 阅读全文
posted @ 2018-10-22 10:59 陈松林 阅读(83) 评论(0) 推荐(0)
摘要:str='''If I should stay I would only be in your way So I'll go But I know I'll think of your every step of the way And I will always love you Will always love you You my darling you Bitter-sweet ... 阅读全文
posted @ 2018-10-15 11:00 陈松林 阅读(184) 评论(0) 推荐(0)
摘要:总结列表,元组,字典,集合的联系与区别: 列表:有序,可做增删改查操作,用方括号[x,y,z]的方式表示 元组:有序,不可做修改操作,用小括号(x,y,z)的方式表示 字典:无序,可做增删改查操作,其中组成元素为键值对,用花括号{a:b,c:d}的方式表示 集合:无序,可由列表创建,其中元素不重复, 阅读全文
posted @ 2018-10-08 10:48 陈松林 阅读(112) 评论(0) 推荐(0)