随笔分类 -  compile-python

主要贡献:1.编译语言python的功能及函数使用方法;2.相应使用python语言的编译器,如pycharm等使用;3.相应的人工智能环境等。
摘要:import numpy as npa=np.array([[11,12,13,14,15,16,17,18],[21,22,23,24,25,26,27,28],[31,32,33,34,35,36,37,38],[41,42,43,44,45,46,47,48]])print(a)b=a[:,::-1] #表示从最后一列开始,每隔1列就取,相当于倒叙print(b) b1=a[:,::-... 阅读全文
posted @ 2019-08-02 09:28 tangjunjun 阅读(692) 评论(0) 推荐(0)
摘要:class Fab(object): def __init__(self ,max ): self.max =max self.n =0 self.a=0 self.b =1 def __iter__(self): #迭代器,表示为容器,相当于声明 return self def __next__( 阅读全文
posted @ 2019-07-30 13:26 tangjunjun 阅读(461) 评论(0) 推荐(0)
摘要:m21文件代码 m22文件代码 阅读全文
posted @ 2019-07-28 22:22 tangjunjun 阅读(1587) 评论(0) 推荐(0)
摘要:import numpy as npimport osa=bytearray(os.urandom(27))# for i in range(21):# print(a[i])a=np.array(a)print(a)b=a.reshape((-1,3))print(b)c=bytearray(b)print(c)for i in range(27): print(a[i]) ... 阅读全文
posted @ 2019-07-22 16:23 tangjunjun 阅读(531) 评论(0) 推荐(0)
摘要:以上用了锐化,只需将以下代码的 cov=np.ones([3,3])/5000# cov[1,1]=1 改成 cov=(-1)*np.ones([3,3])cov[1,1]=9cov=cov/800 以下为简单卷积代码,代码很简单,仔细看将会明白其中含义。我简单说一下,代码思路:读取一幅图,以3通道 阅读全文
posted @ 2019-05-30 16:21 tangjunjun 阅读(323) 评论(0) 推荐(0)
摘要:import osimport shutilimport randomfrom time import strftime, localtimeimport datetimeimport mathimport calendar def getdays(n): # 该函数是N天前或后返回的值 a = d 阅读全文
posted @ 2019-05-22 22:16 tangjunjun 阅读(198) 评论(0) 推荐(0)
摘要:import osimport shutilimport randomprint("\n出行建议原理:随机产生一个天气状况和温度状况,根据此组合以某种概率给出出行建议\n\n") class WEATEM: #此类给出温度和天气情况 def weather(self): b = random.ran 阅读全文
posted @ 2019-05-22 22:15 tangjunjun 阅读(426) 评论(0) 推荐(0)
摘要:import osimport shutilimport randoma=[]print("排序:随机在0到1000中产生100个不重复的整数")for i in range(100): t=random.randint(0,1000) while True: if a==[]: a.append( 阅读全文
posted @ 2019-05-22 22:14 tangjunjun 阅读(175) 评论(0) 推荐(0)
摘要:# coding=utf-8import randomprint("猜数字游戏开始\n")count = 0count1 = 0guessact = random.randint(5, 15)print("猜数提示:取值范围5-15,整数值\n")while 1 == 1: guess = int( 阅读全文
posted @ 2019-05-22 22:12 tangjunjun 阅读(2663) 评论(0) 推荐(0)
摘要:matplotlib表示连续函数图形用plot()函数,表示离散函数图形用scatter()函数。 这2个函数适用二维作图,也适用三维作图。 绘制二维图及三维图重点思维: 无论你绘制二维或是三维,你均可利用函数y=f(x)或z=f(x,y),即 你需要找到自变量与应变量,二维图就需找x,y;三维图就 阅读全文
posted @ 2019-05-13 00:16 tangjunjun 阅读(4726) 评论(0) 推荐(0)

https://rpc.cnblogs.com/metaweblog/tangjunjun