
python
沙子2019
这个作者很懒,什么都没留下…
展开
-
pywinauto常用参数
常用参数表:可传参数 对应属性名称备注class_name ClassNameclass_name_re 正则匹配window Classnametitle Name Window窗口名title_re 正则匹配窗口名best_match 模糊匹配类似的titlehandle 句柄framework_id FrameworkId(一般情况下FrameworkId不是唯一的)process ProcessId,进程id(注意:每次启动后,进程id都会变)control_id control原创 2022-04-18 12:54:35 · 1065 阅读 · 0 评论 -
panda-字符拼接
import pandas as pd1、创建一个两行5列的数据data = [['09:25:13', '6.30', '6.3', '457', '287,910',],['09:25:56', '6.13', '6.13', '556', '340,828',]]df = pd.DataFrame(data)print(df)2、创建一个需要合并的数据df1 = pd.DataFrame(['2021-07-16','2021-07-16'])print(df1)3、合并df[原创 2021-07-16 11:59:29 · 432 阅读 · 0 评论 -
TensorFlow-where、scatter_nd、meshgrid
1、创建一个Tensora = tf.random.normal([3,3])[[ 0.27786183 -0.4933894 0.40996674] [-0.58238053 0.12458259 1.265015 ] [-0.51049304 -1.1052276 1.0958437 ]], shape=(3, 3), dtype=float32)2、创建布尔Tensormask = a>0[[ True False True] [False True Tru原创 2021-07-12 14:11:58 · 148 阅读 · 0 评论 -
TensorFlow-张量限幅
clip_by_value按最大值最小值裁剪a = tf.random.shuffle(tf.range(10))print(tf.clip_by_value(a,2,7))新的tensor最小值为2,最大值为7reluclip_by_norm缩小数值,方向不变gradient clipping指定多层参数的缩放量原创 2021-07-09 15:10:42 · 155 阅读 · 0 评论 -
TensorFlow-填充与复制
1、填充 tf.pad填充顺序为左右上下,最右边为最内层a = tf.reshape(tf.range(9), [3,3])print(tf.pad(a,[[3,1],[4,0]]))2、原创 2021-07-08 16:30:25 · 134 阅读 · 0 评论 -
TensorFlow-数据统计
a = tf.ones([2, 3])1、平方和开根号tf.norm(a), tf.norm(a, ord=2)2、平方和tf.norm(a, ord=1)3、求全局最小值,最大值,平均值a = tf.random.normal([4,10])print(tf.reduce_min(a), tf.reduce_max(a), tf.reduce_mean(a))4、求1轴上最小值, 最大值, 平均值print(tf.reduce_min(a, axis=1), tf.reduce_m原创 2021-07-01 18:02:00 · 123 阅读 · 0 评论 -
TensorFlow-合并与分割
1、合并需指定要合并的轴,其它轴纬度值需要相同tf.concata=tf.ones([4,35,8])b=tf.ones([1,35,8])c = tf.concat([a,b],axis=0)print(c.shape)2、拼接按轴拼接,创建一个新的a=tf.ones([4,35,8])b=tf.ones([4,35,8])c=tf.stack([a,b],axis=-1)c=tf.stack([a,b], axis=1)print(c.shape)3、分离按轴平分a=原创 2021-07-01 17:28:24 · 204 阅读 · 0 评论 -
Plot参数
label 用于图例的标签ax 要在其上进行绘制的matplotlib subplot对象。如果没有设置,则使用当前matplotlib subplotstyle 将要传给matplotlib的风格字符串(for example: ‘ko–’)alpha 图表的填充不透明(0-1)kind 可以是’line’, ‘bar’, ‘barh’, ‘kde’logy 在Y轴上使用对数标尺use_index 将对象的索引用作刻度标签rot 旋转刻度标签(0-360)xticks 用作X轴刻度的值y原创 2021-06-17 14:53:40 · 424 阅读 · 0 评论 -
matplotlib
1、设定x轴,y轴数据x=【1,2,3,4】y=【5,4,3,2】2、新建一个数据plt.figure()3、设定一个2*3图像,并指定第一个plt.subplot(2,3,1)4、将数据赋值到线性图像中plt.plot(x,y)5、显示图像plt.show()6、将数据赋值到柱状图相中plt.subplot(232)plt.bar(x,y)7、柱状图参数width, 柱子的宽度,即在x轴上的长度,默认是0.8color, 柱子的填充色edgecolor, 柱子原创 2021-06-16 10:29:24 · 95 阅读 · 0 评论 -
python 三方可执行文件
windows p = subprocess.Popen(comment, shell=False, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)linuxp = subprocess.Popen(comment, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)错误的返回结果 p.poll()rc为程序返回结果,out打印结果原创 2021-05-20 10:29:03 · 56 阅读 · 0 评论